[skin1]/customer/main/cart.tpl:
Find this line:
Code:
<input type=text size=3 name="productindexes[{$smarty.section.product.index}]" value="{$products[product].amount}">
Delete it out, add some spacing inbetween the other code that is wrapped around it, so you that you can paste the following in:
Code:
{if $config.General.show_in_stock ne "Y"}
{assign var="mq" value=$config.General.max_select_quantity}
{else}
{math equation="min(maxquantity+minamount, productquantity)+1" assign="mq" maxquantity=$config.General.max_select_quantity minamount=$product.min_amount productquantity=$product.avail}
{/if}
{if $product.min_amount le 1}
{assign var="start_quantity" value=1}
{else}
{assign var="start_quantity" value=$product.min_amount}
{/if}
<select name="productindexes[{$smarty.section.product.index}]" onchange="document.cartform.submit()">
{section name=quantity loop=$mq start=$start_quantity}
<option value="{%quantity.index%}" {if $products[product].amount eq %quantity.index%}selected{/if}>{%quantity.index%}</option>
{/section}
</select>
I've also adjusted step 1 of the checkout as well:
[skin1]/customer/main/cart_contents.tpl
Locate the following line:
Code:
<input type=text size=3 name="productindexes[{$smarty.section.product.index}]" value="{$products[prod_num].amount}">
Highlight this entire line of code and replace it with:
Code:
{if $config.General.show_in_stock ne "Y"}
{assign var="mq" value=$config.General.max_select_quantity}
{else}
{math equation="min(maxquantity+minamount, productquantity)+1" assign="mq" maxquantity=$config.General.max_select_quantity minamount=$product.min_amount productquantity=$product.avail}
{/if}
{if $product.min_amount le 1}
{assign var="start_quantity" value=1}
{else}
{assign var="start_quantity" value=$product.min_amount}
{/if}
<select name="productindexes[{$smarty.section.product.index}]" onchange="document.cartform.submit()">
{section name=quantity loop=$mq start=$start_quantity}
<option value="{%quantity.index%}" {if $products[prod_num].amount eq %quantity.index%}selected{/if}>{%quantity.index%}</option>
{/section}
</select>
I'm not too sure if this will work properly with the quantity or inventory check on the product so if you are using a check on inventory & if you do experience the select field selecting the max, disregarding the amount of products available, let me know.
Donations happily accepted
Kudos
