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

Drop down for quantity

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 10-03-2005, 09:27 AM
 
dprice.sf dprice.sf is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 66
 

Default Drop down for quantity

I currently only use the wholesale pricing for my store.

I would like to have the quantity drop down menu display in multiples of 50 rather than 1-999.

Does anyone know where or how I could modify this?
__________________
Version 4.0.14
Reply With Quote
  #2  
Old 10-03-2005, 09:46 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

see customer/buny_now.tpl

and see this

Code:
<SELECT name="amount"> {if $product.min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$product.min_amount} {/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>

also see here on how to use the step function within a section

http://smarty.php.net/manual/en/language.function.section.php
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 10-05-2005, 10:25 AM
 
dprice.sf dprice.sf is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 66
 

Default

Quote:
Originally Posted by shan
see customer/buny_now.tpl

and see this

Code:
<SELECT name="amount"> {if $product.min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$product.min_amount} {/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>

also see here on how to use the step function within a section

http://smarty.php.net/manual/en/language.function.section.php

thanks shan.

i'm still a little confussed about which variable i'll need to modify and how.

i took a look at the link you included - but didn't see an example of a loop based on a fixed variable.
__________________
Version 4.0.14
Reply With Quote
  #4  
Old 10-05-2005, 10:58 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

hi,

its something like this

Code:
{section name=quantity loop=$mq start=$start_quantity step=5}

i added the step value to change the increment

you could also change the start value so that i begins with say 5 instead of 1
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 10-05-2005, 11:26 AM
 
dprice.sf dprice.sf is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 66
 

Default

Quote:
Originally Posted by shan
hi,

its something like this

Code:
{section name=quantity loop=$mq start=$start_quantity step=5}

i added the step value to change the increment

you could also change the start value so that i begins with say 5 instead of 1

made the change as you suggested - but nothing has changed

the code i changed was in /customer/main/buy_now.tpl and is below

Code:
<SELECT name="amount"> {if $product.min_amount le 1} {assign var="start_quantity" value=1} {else} {assign var="start_quantity" value=$product.min_amount} {/if} {section name=quantity loop=$mq start=$start_quantity step=5} <OPTION value="{%quantity.index%}" {if $smarty.get.quantity eq %quantity.index%}selected{/if}>{%quantity.index%}</OPTION> {/section} </SELECT>


that was what you were talking about - right?
__________________
Version 4.0.14
Reply With Quote
  #6  
Old 10-05-2005, 11:34 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

thats just right and should be step=50 for you

youll also need to alter the same code in skin1/customer/main/product.tpl
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #7  
Old 10-05-2005, 11:48 AM
 
dprice.sf dprice.sf is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 66
 

Default

shan - you rock!

that did the trick

much appreciated

d
__________________
Version 4.0.14
Reply With Quote
  #8  
Old 02-20-2006, 11:25 AM
 
gfiebich gfiebich is offline
 

Senior Member
  
Join Date: Feb 2003
Location: St. Paul, MN
Posts: 108
 

Default

I modified Shan's idea a bit to allow my site to sell both single items and items in case quantities. My mod is here: http://forum.x-cart.com/viewtopic.php?t=26655
__________________
NO LONGER USING X-CART - NOT ACTIVE IN THESE FORUMS
Reply With Quote
  #9  
Old 08-10-2007, 04:52 PM
 
zenkitty zenkitty is offline
 

Newbie
  
Join Date: Jun 2007
Posts: 1
 

Default Re: Drop down for quantity

I can't seem to get this to work on my site. I need to change the quantity dropdown on the product details page to increments of 500. I've added the step function into the section for the quantity dropdown in /customer/main/product.tpl.

This is what my code looks like:
PHP Code:
<select id="product_avail" name="amount"{if $active_modules.Product_Options ne '' && $product_options ne ''onchange="check_wholesale(this.value);"{/if}>
{
section name=quantity loop=$mq start=$start_quantity step=500}
<
option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option>
{/
section


However, the quantity dropdown still shows increments of 1. Is there something I'm missing? Has something changed with the latest version of X-cart which means this code no longer works?

If anyone can help me with this, I'd be very grateful! Thanks!

Regards
Deb
__________________
X-Cart 4.1.8
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 01:37 PM.

   

 
X-Cart forums © 2001-2020