![]() |
Changing quantity selectbox amount for individual product
Is there a way to change the quantity dropdown amount for individual product? For example you have "Maximum number of selections in quantity selectbox:" set to 100, but for one product you want it to be only 50.
|
Re: Changing quantity selectbox amount for individual product
After a little more digging I realized that quantity changes in the dropdown selectbox are tied to inventory levels. Since I have disable inventory on this site, I decided to just go the route of replacing the dropdown select with a text input field. Here is what I did in case anyone else has this need:
I took this code in product.tpl: HTML Code:
and replaced it with this: HTML Code:
Basically I just added a text input fieLd with the same name as the selectbox, "amount". Then I just commented out the select in case I ever want to use it again. |
Re: Changing quantity selectbox amount for individual product
Nice !!!
|
Re: Changing quantity selectbox amount for individual product
Make sure to set a default value of 1 by adding value="1" to the code like shown below...
<input type="text" name="amount" size="3" value="1"> {* hide dropdown selectbox <SELECT id="product_avail" name="amount" {if $active_modules.Product_Options ne '' && $product_options ne ''} onchange="check_options();"{/if}> {section name=quantity loop=$mq start=$start_quantity} <OPTION value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</OPTION> {/section} </SELECT> *} |
Re: Changing quantity selectbox amount for individual product
Debra's fix for this was similar, but she also added a variable to set the default value the same way as the product's minimum:
<input type="text" name=amount size="4" value="{$product.min_amount}"> Here: http://forum.x-cart.com/showpost.php?p=109039&postcount=7 The problem I'm having (if you haven't noticed from some related posts -- please excuse the possible duplication), is with multiple ('wholesale') pricing levels. Am not sure how to execute this js function with a text box when it replaces the drop-down --- the javascript is supposed to update the price immediately based on the quantity being 'moused over', (er, mouseovered?). |
Re: Changing quantity selectbox amount for individual product
why dont you change it to "onchange" instead of "onmouseover"?
|
Re: Changing quantity selectbox amount for individual product
am not sure where that js file is, but that's an idea. Main problem right now though, is that the price isn't being updated even when the product lands in the cart!
|
All times are GMT -8. The time now is 02:58 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.