X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Drop down for quantity (https://forum.x-cart.com/showthread.php?t=17046)

dprice.sf 10-03-2005 09:27 AM

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?

shan 10-03-2005 09:46 AM

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

dprice.sf 10-05-2005 10:25 AM

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.

shan 10-05-2005 10:58 AM

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

dprice.sf 10-05-2005 11:26 AM

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?

shan 10-05-2005 11:34 AM

thats just right and should be step=50 for you

youll also need to alter the same code in skin1/customer/main/product.tpl

dprice.sf 10-05-2005 11:48 AM

shan - you rock!

that did the trick

much appreciated

d

gfiebich 02-20-2006 11:25 AM

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

zenkitty 08-10-2007 04:52 PM

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


All times are GMT -8. The time now is 12:07 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.