Varianten als Liste in product.tpl

Hallo liebe Leute,

ich möchte meinen Kunden ermöglichen schon in der Artikelübersicht die Varianten aus einer tabellarischen Auflistung direkt mit Mengen angabe in den Warenkorb zu legen.

So wie es in den Artikeldetails möglich ist.

Jedoch bekomme ich nur diese Dropdownliste hin, alle versuche den Code aus der details.tpl in die product.tpl zu übernehmen scheiterten.

Irgendwer eine Idee?

lg Oliver

Hat keiner eine Idee? Einen Ansatz? Ich kennen hunderte Shops wo die Varianten als Tabelle angezeigt werden, aber nur eine Handvoll wo es wie von Oxid per Dropdownliste gelöst wird.

Welche Shops denn? In den meisten Shops die ich kenne kann man gar nicht aus der Listenansicht in den Warenkorb legen.

z.B.

http://www.petshop.de/shop/Hunde/hundefutter_trockenfutter/ROYAL_CANIN_Rassehunde/22335

http://www.zooplus.de/shop/hunde/hundefutter_trockenfutter/royal_canin_size/70613

und genau so bräuchten wir das auch.

Da musst du aus dem einen Formular in der product.tpl ein Formular pro Variante machen. In jedem dieser Formulare müssen alle hidden Felder vorhanden sein plus die jeweilige aid aus dem Select.

Weil die product.tpl für verschiedene Darstellungen da ist, würde ich mir eine Kopie davon machen und diese aus der list.tpl aufrufen.

Vielen Dank für den Ansatz.

Eine frage noch, die details.tpl macht ja schon genau das was ich möchte. also die Varianten als Liste anzeigen. Wo dran scheitert es wenn ich den Code aus der details.tpl in die product.tpl kopiere. Habe da schon viel probiert. Also die $oView in $product unbenannt, alles mögliche an Datei mit ins include genommen doch nichts hat geholfen.

Ich muss dazu gestehen das ich zwar Programmierer bin, allerdings waren bisher eher ASP/.NET/VB meine Welt. (Habe mir schon ein CSV Importtool und eine kleine WAWI für oxid gebastelt). Aber an dieser Variantenansicht scheitere ich :frowning:

lg Oliver

In details wird ja für die Varianten-Darstellung wieder product.tpl includet, das wird dann wohl ein wenig Matrjoschka-mässig :).

ah, das liegt der hase im pfeffer… hat das vllt. jemand schon mal so realisiert?

Blöde Frage, ich dachte, das soll in der Listenansicht schon so aussehen, gehts jetzt nur noch um die Detailansicht und dann um die Varianten darunter? Das geht doch wohl schon im Standard, wenn ich mich recht entsinne, jedenfalls taucht da doch ein Warenkorb Button neben jeder Variante auf, eine Mengenfeld daneben zu packen, sollte doch kein Problem darstellen.

Multidimensionale Varianten müssten dann ausgeschaltet sein.

In der Listenansicht alle Varianten zu laden, wird schon sehr, sehr unübersichtlich…

Viele Grüße vom Chris

Hallo, wir haben immer 3 Varianten von einem Artikel und deshalb würde wir es gut finden wenn der Kunden jede Variante direkt aus der Artikelübersicht kaufen kann und zwar so aufgelistet wie in der Detailansicht und nicht wie eben Oxid-Standard per Dropdown.

Vielleicht kannst Du Dir hieraus was zusammenpflücken (wie es funktioniert, siehst Du zB unter http://www.enveda.de/vitalfood/grasprodukte/bionika-ii-saftpresse-entsafter.html):



         [{if $oView->drawParentUrl()}]
            <a class="zurueck" id="test_backToParent" href="[{$oView->getParentUrl()}]">[{oxmultilang ident="INC_PRODUCT_VARIANTS_BACKTOMAINPRODUCT"|oxmultilangassign|cat:" "|cat:$oView->getParentName() }]</a>
         [{/if}]
	<form name="tobasket.[{$testid}]" action="[{ $oViewConf->getSelfActionLink() }]" method="post">
    [{capture name=product_price}]
    [{* oxhasrights ident="SHOWARTICLEPRICE"}]
        <div id="test_price_[{$testid}]" class="price">
            [{if $product->getFTPrice() && $size=='big' }]
                <b class="old">[{ oxmultilang ident="DETAILS_REDUCEDFROM" }] <del>[{ $product->getFTPrice()}] [{ $currency->sign}]</del></b>
                <span class="desc">[{ oxmultilang ident="DETAILS_REDUCEDTEXT" }]</span><br>
                <sub class="only">[{ oxmultilang ident="DETAILS_NOWONLY" }]</sub>
            [{/if}]
            [{if $product->getFPrice()}]
              <big>[{ $product->getFPrice() }] [{ $currency->sign}]</big><sup class="dinfo"><a href="#delivery_link" rel="nofollow">*</a></sup>
            [{else}]
              <big> </big>
            [{/if}]
        </div>
    [{/oxhasrights *}]
    [{/capture}]

 <div class="variants">
    [{ $oViewConf->getHiddenSid() }]
    [{ $oViewConf->getNavFormParams() }]

    <input type="hidden" name="cl" value="[{ $oViewConf->getActiveClassName() }]">

    [{if $owishid}]
      <input type="hidden" name="owishid" value="[{$owishid}]">
    [{/if}]
    [{if $toBasketFunction}]
      <input type="hidden" name="fnc" value="[{$toBasketFunction}]">
    [{else}]
      <input type="hidden" name="fnc" value="tobasket">
    [{/if}]

    <input type="hidden" name="aid" value="[{ $product->oxarticles__oxid->value }]">
    [{if $altproduct}]
        <input type="hidden" name="anid" value="[{ $altproduct }]">
    [{else}]
        <input type="hidden" name="anid" value="[{ $product->oxarticles__oxnid->value }]">
    [{/if}]

    [{if $recommid}]
    <input type="hidden" name="recommid" value="[{ $recommid }]">
    [{/if}]
    <input type="hidden" name="pgNr" value="[{ $pageNavigation->actPage-1 }]">

    [{if $size!='thin' && $size!='thinest'}]
    <input id="test_am_[{$testid}]" type="hidden" name="am" value="1">
    [{/if}]
	<table class="preisliste" cellspacing="0"><tbody>
	
	[{ if !$product->getVariantList() }]
    

	<tr>
     <td rowspan="2" class="Radio"><INPUT TYPE="Radio" class="Rb" name="aid" id="id[{$vId}]" value="[{$product->getId()}]" [{if $smarty.foreach.varradio.first}] checked="checked" [{/if}]><div class="unchecked"></div></td><td colspan="2"><label for="id[{$vId}]" class="Variantenliste"><h3><em class="dunkler">[{ $product->oxarticles__oxtitle->value|Html_Entity_Decode }]</em></h3></label></td>
	 <tr class="[{$CellCSS}]">
	 <td>[{$product->oxarticles__oxartnum->value}]</td>
	 <td class="Preis">[{if $product->getPricePerUnit() > 0  }]<span class="PreisUnit">([{$product->getPricePerUnit()}] [{ $currency->sign}]/[{$product->oxarticles__oxunitname->value}])</span> [{/if}] <b class="dunkler">  [{ $product->getFPrice() }] [{ $currency->sign|strip_tags}]</b></td>
	</tr>
	   [{if $product->getFTPrice() }]
<tr class="[{$CellCSS}]"><td></td><td class="right PreisUnit" colspan ="2">       
	   <b class="old">[{ oxmultilang ident="DETAILS_REDUCEDFROM" }] <del>[{ $product->getFTPrice()}] [{ $currency->sign}]</del></b>
                [{ oxmultilang ident="DETAILS_REDUCEDTEXT" }]<!-- <br>
                <sub class="only">[{ oxmultilang ident="DETAILS_NOWONLY" }]</sub> -->
</td></tr>   
   [{/if}]
   
	   
     [{if $product->loadAmountPriceInfo()}]
	          [{foreach from=$product->loadAmountPriceInfo() item=priceItem name=mrabatt}]
     <tr class="[{$CellCSS}] Angebot"> <td> </td>
           <td>[{if $smarty.foreach.mrabatt.first}][{ oxmultilang ident="DETAILS_MOREYOUBUYMOREYOUSAVE" }][{/if}]</td><td  id="test_amprice_[{$priceItem->oxprice2article__oxamount->value}]_[{$priceItem->oxprice2article__oxamountto->value}]">[{ oxmultilang ident="DETAILS_FROM" }] [{$priceItem->oxprice2article__oxamount->value}] [{ oxmultilang ident="DETAILS_PCS" }]
             
               [{if $priceItem->oxprice2article__oxaddperc->value}]
                 - [{$priceItem->oxprice2article__oxaddperc->value}] [{ oxmultilang ident="DETAILS_DISCOUNT" }]
               [{else}]
                 - [{$priceItem->fbrutprice}] [{ $currency->sign}]
               [{/if}]
			   [{if $product->getPricePerUnit() > 0  }]<span class="PreisUnit">([{$priceItem->fPricePerUnitBrutto}] [{ $currency->sign}]/[{$product->oxarticles__oxunitname->value}])</span> [{/if}]
             </td>
           </tr>
         [{/foreach}]
       
	   </tr>
    [{/if}]
    
    </tr>


    [{/if}]



Obiges habe ich als var_orderlist.tpl angelegt, das ich in die details.tpl einbinde (zweiter Teil des Codestücks im nä Post).

Die Funktionen sind tlw mit jquery vermengt, daher wirst du einiges rausnudeln müssen.

Viel Erfolg!
A.


[{foreach name=varradio  from=$product->getVariantList() item=variant}]
	[{assign var="vId" value=$variant->getId()}]
	[{cycle values='HellCell,DunkelCell' assign=CellCSS}]
	<tr class="[{$CellCSS}] CellClick" setter="id[{$vId}]">
     <td rowspan="2" class="Radio"><INPUT TYPE="Radio" class="Rb" name="aid" id="id[{$vId}]" value="[{$variant->getId()}]" [{if $smarty.foreach.varradio.first}]checked="checked"[{/if}]><div class="unchecked" setter="id[{$vId}]"> </div></td><td colspan="2"><label for="id[{$vId}]" class="Variantenliste"><h3><em class="dunkler">[{ $variant->oxarticles__oxtitle->value|Html_Entity_Decode }]</em></h3></label></td>
	 <tr class="[{$CellCSS}] CellClick" setter="id[{$vId}]">
	 <td>[{$variant->oxarticles__oxartnum->value}]  [{if Html_Entity_Decode($variant->oxarticles__oxlongdesc) <> " "}]<a class="PreisUnit" href="[{$variant->getLink()}]">[{ oxmultilang ident="VAR_MOREINFO" }]</a>[{/if}]</td>
	 <td class="Preis">[{if $variant->getPricePerUnit() > 0  }]<span class="PreisUnit">([{$variant->getPricePerUnit()}] [{ $currency->sign}]/[{$variant->oxarticles__oxunitname->value}])</span> [{/if}] <b class="dunkler">  [{ $variant->getFPrice() }] [{ $currency->sign|strip_tags}]</b></td>
	</tr>
	   
	            [{if $variant->getFTPrice() }]
<tr class="[{$CellCSS}] CellClick" setter="id[{$vId}]"><td></td><td class="right PreisUnit" colspan ="2">       
	   <b class="old">[{ oxmultilang ident="DETAILS_REDUCEDFROM" }] <del>[{ $variant->getFTPrice()}] [{ $currency->sign}]</del></b>
                [{ oxmultilang ident="DETAILS_REDUCEDTEXT" }]
				
				
</td></tr>   
   [{/if}]
                      
   
	   
     [{if $variant->loadAmountPriceInfo()}]
	          [{foreach from=$variant->loadAmountPriceInfo() item=priceItem name=mrabatt}]
     <tr class="[{$CellCSS}] Angebot CellClick" setter="id[{$vId}]"> <td></td>
           <td>[{if $smarty.foreach.mrabatt.first}][{ oxmultilang ident="DETAILS_MOREYOUBUYMOREYOUSAVE" }][{/if}]</td><td  id="test_amprice_[{$priceItem->oxprice2article__oxamount->value}]_[{$priceItem->oxprice2article__oxamountto->value}]">[{ oxmultilang ident="DETAILS_FROM" }] [{$priceItem->oxprice2article__oxamount->value}] [{ oxmultilang ident="DETAILS_PCS" }]
             
               [{if $priceItem->oxprice2article__oxaddperc->value}]
                 - [{$priceItem->oxprice2article__oxaddperc->value}] [{ oxmultilang ident="DETAILS_DISCOUNT" }]
               [{else}]
                 - [{$priceItem->oxprice2article__oxaddabs->value}] [{ $currency->sign}]
               [{/if}]
			   [{if $variant->getPricePerUnit() > 0  }]<span class="PreisUnit">([{$priceItem->fPricePerUnitBrutto}] [{ $currency->sign}]/[{$variant->oxarticles__oxunitname->value}])</span> [{/if}]
             </td>
           </tr>
         [{/foreach}]
       
	   </tr>
    [{/if}]
    
    </tr>
	[{/foreach}]
	[{assign var="oCont" value=$oView->getContentByIdent("oxdeliveryinfo") }]
    <tr class="nobkgr"><td class="dinfo PreisUnit" colspan="3">
	[{ if $product->oxarticles__oxstocktext->value  }]
    [{ $product->oxarticles__oxstocktext->value }][{else}][{ oxmultilang ident="DETAILS_READYFORSHIPPING }][{/if}]. Preise [{ oxmultilang ident="DETAILS_PLUSSHIPPING" }]<a class="PreisUnit" href="[{ $oCont->getLink() }]" rel="nofollow">[{ oxmultilang ident="DETAILS_PLUSSHIPPING2" }]</a>     

			</td></tr>
			
			
    [{* if $product->getVariantList() && ($size!='thinest') }]
      <label>[{ $product->oxarticles__oxvarname->value }]:</label>

      [{ if $product->hasMdVariants() }]
      <select id="mdVariant_[{$testid}]" name="mdVariant_[{$testid}]">
        [{ if !$product->isParentNotBuyable()}]
          <option value="[{$product->getId()}]">[{ $product->oxarticles__oxvarselect->value }] [{oxhasrights ident="SHOWARTICLEPRICE"}] [{ $product->getFPrice() }] [{ $currency->sign|strip_tags}]*[{/oxhasrights}]</option>
        [{/if}]

        [{foreach from=$product->getMdSubvariants() item=mdVariant}]
          <option value="[{$mdVariant->getLink()}]">[{ $mdVariant->getName() }] [{oxhasrights ident="SHOWARTICLEPRICE"}] [{ $mdVariant->getFPrice()|strip_tags }]* [{/oxhasrights}]</option>
        [{/foreach}]
      </select>
      [{else}]
      <select id="test_varSelect_[{$testid}]" name="aid">
        [{ if !$product->isParentNotBuyable()}]
          <option value="[{$product->getId()}]">[{ $product->oxarticles__oxtitle->value|Html_Entity_Decode }] [{oxhasrights ident="SHOWARTICLEPRICE"}] [{ $product->getFPrice() }] [{ $currency->sign|strip_tags}]*[{/oxhasrights}]</option>
        [{/if}]
        [{foreach from=$product->getVariantList() item=variant}]
          <option value="[{$variant->getId()}]">[{ $variant->oxarticles__oxtitle->value|Html_Entity_Decode }] [{oxhasrights ident="SHOWARTICLEPRICE"}] [{ $variant->getFPrice() }] [{ $currency->sign|strip_tags}]* [{/oxhasrights}]</option>
        [{/foreach}]
      </select> 


      [{/if }]

   
   [{ if !$product->isParentNotBuyable()}]
        <INPUT TYPE="Radio" name="aid" value="[{$product->getId()}]"> [{ $product->oxarticles__oxtitle->value|Html_Entity_Decode }] [{oxhasrights ident="SHOWARTICLEPRICE"}] [{ $product->getFPrice() }] [{ $currency->sign|strip_tags}]* ([{$variant->getPricePerUnit()}] [{ $currency->sign}]/[{$product->oxarticles__oxunitname->value}])[{/oxhasrights}]</option> <br>
	[{/if}]
     
	 [{foreach from=$product->getVariantList() item=variant}]
       <INPUT TYPE="Radio" name="aid" value="[{$variant->getId()}]"> [{ $variant->oxarticles__oxtitle->value|Html_Entity_Decode }] [{oxhasrights ident="SHOWARTICLEPRICE"}] [{ $variant->getFPrice() }] [{ $currency->sign|strip_tags}]* [{if $variant->getPricePerUnit() > 0  }]([{$variant->getPricePerUnit()}] [{ $currency->sign}]/[{$variant->oxarticles__oxunitname->value}]) [{/if}][{/oxhasrights}]</option> <br>
        [{/foreach}]
       
 
	  
	  
    [{elseif $product->getDispSelList()}]
      [{foreach key=iSel from=$product->selectlist item=oList}]
        <label>[{ $oList.name }] :</label>
        <select id="test_sellist_[{$testid}]_[{$iSel}]" name="sel[[{$iSel}]]" onchange="oxid.sellist.set(this.name,this.value);">
          [{foreach key=iSelIdx from=$oList item=oSelItem}]
            [{ if $oSelItem->name }]
              <option value="[{$iSelIdx}]"[{if $oSelItem->selected }]SELECTED[{/if }]>[{ $oSelItem->name }]</option>
            [{/if}]
          [{/foreach}]
        </select>
      [{/foreach}]
    [{/if *}]



    [{if $size!='big'}] [{$smarty.capture.product_price}] [{/if}]

    [{oxhasrights ident="TOBASKET"}]
        [{ if !$product->isNotBuyable() && !$product->hasMdVariants() }]

        [{if $size=='thin' || $size=='thinest'}]
<tr class="orderbtn"><td class="orderbtn" colspan="3">
		<div class="amount">
            <label>[{ oxmultilang ident="DETAILS_QUANTITY" }]</label>
			<!-- <input id="test_am_[{$testid}]" type="text" name="am" value="1" size="2" class="iamount">  -->
			        <select name="am">		
				 	<option value="1">1
				 	<option value="2">2
				 	<option value="3">3
				 	<option value="4">4
				 	<option value="5">5
				 	<option value="6">6
				 	<option value="7">7
				 	<option value="8">8
				 	<option value="9">9
				 	<option value="10">10
				</select>
						 <div class="tocart"><input id="test_toBasket_[{$testid}]" type="submit" value="[{if $size=='small'}][{oxmultilang ident="INC_PRODUCTITEM_ADDTOCARD3" }][{else}][{oxmultilang ident="INC_PRODUCTITEM_ADDTOCARD2"}][{/if}]" onclick="oxid.popup.load();"></div>
        </div>
		</td></tr></tbody></table>
</div>
        [{/if}]
       
        [{/if}]
    [{/oxhasrights}]

    [{if $product->hasMdVariants() }]
    <span class="btn moreinfo">
        <a id="test_variantMoreInfo_[{$testid}]" class="" href="[{ $_productLink }]" onclick="oxid.mdVariants.getMdVariantUrl('mdVariant_[{$testid}]'); return false;">[{ oxmultilang ident="INC_PRODUCT_VARIANTS_MOREINFO" }]</a>
    </span>
    [{/if}]

    </form>

    [{if $removeFunction && (($owishid && ($owishid==$oxcmp_user->oxuser__oxid->value)) || (($wishid==$oxcmp_user->oxuser__oxid->value))) }]
    <form action="[{ $oViewConf->getSelfActionLink() }]" method="post">
      <div>
          [{ $oViewConf->getHiddenSid() }]
          <input type="hidden" name="cl" value="[{ $oViewConf->getActiveClassName() }]">
          <input type="hidden" name="fnc" value="[{$removeFunction}]">
          <input type="hidden" name="aid" value="[{$product->oxarticles__oxid->value}]">
          <input type="hidden" name="am" value="0">
          <input type="hidden" name="itmid" value="[{$product->getItemKey()}]">
      </div>
      <div class="fromlist">
          <input id="test_remove_[{$testid}]" type="submit" value="[{ oxmultilang ident="INC_NOTICE_PRODUCT_ITEM_REMOVE" }]">
      </div>
    </form>
    [{/if}]

    [{if $removeFunction && $recommid }]
    <form action="[{ $oViewConf->getSelfActionLink() }]" method="post">
      <div>
          [{ $oViewConf->getHiddenSid() }]
          <input type="hidden" name="cl" value="[{ $oViewConf->getActiveClassName() }]">
          <input type="hidden" name="fnc" value="[{$removeFunction}]">
          <input type="hidden" name="aid" value="[{$product->oxarticles__oxid->value}]">
          <input type="hidden" name="recommid" value="[{$recommid}]">
      </div>
      <div class="fromlist">
          <input id="test_remove_[{$testid}]" type="submit" value="[{ oxmultilang ident="INC_RECOMM_PRODUCT_ITEM_REMOVE" }]">
      </div>
    </form>
    [{/if}]

</div>



@oxal: tausend dank für deine mühe. Leider versuche ich diese Anzeige in der product.tpl zu realisieren und nicht in der details.tpl.

Also das ich bereits in der Artikelübersicht die Variantenauswahl als Tabelle und nicht als Dropdown habe.

Trotzdem noch mal vielen Dank.

Oliver

[QUOTE=GhostDogDE;51795]@oxal: tausend dank für deine mühe. Leider versuche ich diese Anzeige in der product.tpl zu realisieren und nicht in der details.tpl.

Also das ich bereits in der Artikelübersicht die Variantenauswahl als Tabelle und nicht als Dropdown habe.
[/QUOTE]

Und, hast du es geschafft? Ich stehe gerade vor dem gleichen Problem, daher würde mich deine Lösung [B]sehr [/B] interessieren.

Viele Grüße
Volker