Hello,
I've noticed that using variants and selection-lists at the same time can be quite irritating in some cases.

If the article has different variants it will not be buyable directly (because you can only buy its variants). For that reason i added an additional check to the detail.tpl, that prevents a select-list from being displayed in that case (the dropdown would not be usable anyway, but can irritate the user).

In the product.tpl I basically added the select-list code from detail.tpl, to enable the user to add an article to his shopping cart with a selected value from a select-list (previous behavior was, that the first selectable value was set).

I hope I was not unclear about my intentions. I would appreciate any feedback.

Jan Sandbrink
Index: out/basic/tpl/details.tpl
===================================================================
--- out/basic/tpl/details.tpl   (revision 462)
+++ out/basic/tpl/details.tpl   (working copy)
@@ -165,7 +165,7 @@
     <input type="hidden" name="anid" value="[{ 
$product->oxarticles__oxnid->value }]">
     </div>
 
-    [{if $oView->getSelectLists() }]
+    [{if $oView->getSelectLists() && $product->isBuyable() }]
     [{foreach key=iSel from=$oView->getSelectLists() item=oList}]
      <div class="variants">
       <label>[{ $oList.name }]:</label>
Index: out/basic/tpl/inc/product.tpl
===================================================================
--- out/basic/tpl/inc/product.tpl       (revision 462)
+++ out/basic/tpl/inc/product.tpl       (working copy)
@@ -149,6 +149,18 @@
         [{ if !$product->isNotBuyable() && !$product->hasMdVariants() }]
 
         [{if $size=='thin' || $size=='thinest'}]
+               
+               [{if $oView->getSelectLists() }]
+               [{foreach key=iSel from=$oView->getSelectLists() item=oList}]
+               <label>[{ $oList.name }]:</label>
+               <select 
id="test_select_[{$product->oxarticles__oxid->value}]_[{$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}]">[{ $oSelItem->name }]</option>[{/if}]
+                       [{/foreach}]
+               </select>
+               [{/foreach}]
+               [{/if}]
+               
         <div class="amount">
             <label>[{ oxmultilang ident="DETAILS_QUANTITY" }]</label><input 
id="test_am_[{$testid}]" type="text" name="am" value="1" size="3">
         </div>
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to