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)
-   -   removing quantity (https://forum.x-cart.com/showthread.php?t=8891)

kkrieger 08-12-2004 05:34 PM

removing quantity
 
Hello,

I'm looking to remove the quantity from my products. I've read past posts about setting the maximum quanitiy to 0 in general settings but I can not find this in the version I am running

Cart: 4[1].0.1 - Xcart Gold

I have a modificator dropdown in use to set the price via the quantity and basically want the basic quantity drop down off the site.

Any and all help is greatly apprieciated!

twulff 08-13-2004 11:26 PM

Why you not just edit the tpl code of cutomers/product.tpl and set the product form of the quantity to a hidden field with 1 as value and the rest of this field you just comment out?

cotc2001 08-14-2004 07:34 AM

Just what I was about to say :D

coresmart71 05-20-2008 12:47 PM

Re: removing quantity
 
Can this "fix" be done for only a select group of products? Say for one particular category rather than all of them?

I have some products that we'd like to have the quantity dropdown, but on others, we'd like to just use the add to cart button so it limits the purchase to one at a time because we are using memo fields in the product options that must be filled out per each item purchased.

Thanks,

lisa b.
Xcart Gold v 4.1.8

jbvideo 08-12-2008 08:16 AM

Re: removing quantity
 
bump

same question.

can we limit the quantity option to specific categories?

We sell mostly dvds so we want customers to only purchase 1 at a time. But we do have another category or two where customers purchase multiple items.

how can I remove the quantity box on the dvd category but make it available on other categories?

ARW VISIONS 08-12-2008 10:20 AM

Re: removing quantity
 
****make Sure You Backup Files******

to remove the quantity box -

find this code in product.tpl

<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}
<option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option>
{/section}
</select>


Comment it out

{*
<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}
<option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option>
{/section}
</select>
*}


Add this just below the commented code.

<input type="hidden" name="amount" value="1" />



if you want to use this for certain categories or products write an if/else statement.


{if $cat eq 500}
{*
<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}
<option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option>
{/section}
</select>
*}
<input type="hidden" name="amount" value="1" />
{else}
<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}
<option value="{%quantity.index%}"{if $smarty.get.quantity eq %quantity.index%} selected="selected"{/if}>{%quantity.index%}</option>
{/section}
</select>
{/if}

You will have to replace the cat id - 500 with whatever your cat id is.

jbvideo 08-12-2008 01:19 PM

Re: removing quantity
 
Ashley,

I really appreciate you taking the time to answer and provide code, but it is not working for me.

When I tried your first solution to comment out the code and add <input type="hidden" name="amount" value="1" />

the quantity drop down box disappeared (but the word quantity still remained)

So then I tried your second solution with the if/else statement (replacing the category code with the approriate number) but nothing happened. The quantity box and drop down box still exists in all my categories.

::sigh::

ARW VISIONS 08-12-2008 07:19 PM

Re: removing quantity
 
Ok do you know the category id that you want to comment out? You can find it in the url.

example - test/xcart/home.php?cat=3


To remove the word Quantity comment out this code.

{*<td height="25" width="30%">{$lng.lbl_quantity}{if $product.min_amount gt 1}<br /><font class="ProductDetailsTitle">{$lng.txt_need_min_amo unt|substitute:"items":$product.min_amount}</font>{/if}</td>*}

wayfarer 09-07-2008 10:06 PM

Re: removing quantity
 
I'm interested in implementing this in our store. I have just one category where I would need a quantity box, the rest from which I want it removed. I played around with Ashley's if and else statement, effectively switching it around to exclude the quantity box from all categories except the one that requires it. That's all fine.

However, how do I make the display of the quantity label conditional on whether the box is displaying or not? Surely just commenting it out would mean that in my chosen category where I am displaying the quantity drop down, the label wouldn't display...

ARW VISIONS 09-07-2008 10:11 PM

Re: removing quantity
 
use the same one you used for the drop down. just place it around the qty label.


All times are GMT -8. The time now is 10:13 AM.

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