Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Changing quantity selectbox amount for individual product

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-18-2006, 02:49 PM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default 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.
__________________
X-Cart: 4.0.18
Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2
Reply With Quote
  #2  
Old 09-19-2006, 10:48 AM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default 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:
<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>

and replaced it with this:
HTML Code:
<input type="text" name="amount" size="3"> {* 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> *}

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
Reply With Quote
  #3  
Old 09-25-2006, 08:06 PM
 
vixnfox vixnfox is offline
 

Advanced Member
  
Join Date: Feb 2006
Location: Adelaide, South Australia
Posts: 82
 

Default Re: Changing quantity selectbox amount for individual product

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
Reply With Quote
  #4  
Old 10-27-2006, 12:19 PM
 
vbworm7 vbworm7 is offline
 

Newbie
  
Join Date: Jan 2003
Posts: 1
 

Default 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>
*}
__________________
xcart v4.1.2 [unix]
Reply With Quote
  #5  
Old 01-02-2007, 07:47 PM
 
paperlion paperlion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 89
 

Default 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?).
__________________
Gold 4.0.19
Reply With Quote
  #6  
Old 01-03-2007, 10:36 AM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default Re: Changing quantity selectbox amount for individual product

why dont you change it to "onchange" instead of "onmouseover"?
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote
  #7  
Old 01-03-2007, 10:50 AM
 
paperlion paperlion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 89
 

Default 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!
__________________
Gold 4.0.19
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:13 PM.

   

 
X-Cart forums © 2001-2020