| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Changing quantity selectbox amount for individual product | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() 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.
__________________
X-Cart: 4.0.18 Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2 |
|||||||||
#2
|
|||||||||
|
|||||||||
![]() 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.
__________________
X-Cart: 4.0.18 Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2 |
|||||||||
#3
|
|||||||
|
|||||||
![]() Nice !!!
__________________
V 4.3.1 Live: Developing on PHP 5.3.0 MySQL server 5.0.75-community-log MySQL client 5.1.36 Web server Apache/2.2.11 (Unix) mod_ssl/2.2.11 Windows 7 64bit on a Toshiba Satellite P500 ADELAIDE, SOUTH AUSTRALIA |
|||||||
#4
|
|||||||
|
|||||||
![]() 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> *}
__________________
xcart v4.1.2 [unix] |
|||||||
#5
|
|||||||
|
|||||||
![]() 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?).
__________________
Gold 4.0.19 |
|||||||
#6
|
|||||||
|
|||||||
![]() why dont you change it to "onchange" instead of "onmouseover"?
|
|||||||
#7
|
|||||||
|
|||||||
![]() 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!
__________________
Gold 4.0.19 |
|||||||
![]() |
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|