Jump to content

Quantity as dropdown menu instead of textbox


Arj1

Recommended Posts

Hello!


On the product page (product.tpl) where the customer pick the quantity wanted of the item, they have to type the quantity in a textbox, how do I change that textbox to a dropdown menu?

Ive searched the forum but i didnt find any answers.


Thanks

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...

<!-- quantity wanted -->

quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>
{$product->minimal_quantity} == {$combination.minimal_quantity} == {$product->minimal_quantity}
{if $product->minimal_quantity > 1}



{$product->minimal_quantity}

{$product->minimal_quantity*2}

{$product->minimal_quantity*3}

{$product->minimal_quantity*4}

{$product->minimal_quantity*5}



{else}{if $product->minimal_quantity <= 1}



1

2

3

4

5

6

7

8

9

10



{/if}{/if}

Link to comment
Share on other sites

Try the following, this is with minimum qty for 1.4vr, and there are two option, change your select option as you need , here are 1-10 for all product, and upto 5 times for minimum qty product that are min more than 1


 <!-- quantity wanted  -->


quantity <= 0) OR $virtual OR !$product->available_for_order OR $PS_CATALOG_MODE} style="display: none;"{/if}>

               {if $product->minimal_quantity > 1}



{$product->minimal_quantity}

{$product->minimal_quantity*2}

{$product->minimal_quantity*3}

{$product->minimal_quantity*4}

{$product->minimal_quantity*5}



               {else}{if $product->minimal_quantity <= 1}



1

2

3

4

5

6

7

8

9

10



               {/if}{/if}


Link to comment
Share on other sites

  • 5 months later...

this will load the product quantity into the dropdown combo box

 

  <label>{l s='Quantity:'}</label>
   <select type="text" title="{l s='Quantity'}" name="qty" id="quantity_wanted" class="text" style="width:auto;">
   {section name=foo loop=$product->quantity}
 {l s=' <option value="'}{$smarty.section.foo.iteration}{l s='">'}{$smarty.section.foo.iteration}{l s='</option>'}
 <br />
   {/section}  
   </select>

Link to comment
Share on other sites

Correction.

 

  <label>{l s='Quantity:'}</label>
   <select type="text" title="{l s='Quantity'}" name="qty" id="quantity_wanted" class="text" style="width:auto;">
   <option value="1">2</option>
   {section name=foo loop=$product->quantity}
 <option value="{$smarty.section.foo.iteration}">{$smarty.section.foo.iteration}</option>
 <br />
   {/section}
   </select>

  • Like 3
Link to comment
Share on other sites

  • 5 months later...
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...