![]() |
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! |
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?
|
Just what I was about to say :D
|
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 |
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? |
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. |
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:: |
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>*} |
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... |
Re: removing quantity
use the same one you used for the drop down. just place it around the qty label.
|
Re: removing quantity
Quote:
Incidentally, if I had a second category I wanted to include, would I just repeat the if else statement again for the desired categories, or can I do something like this?: {if $cat eq 500, 451} |
Re: removing quantity
You are welcome.
Im not sure about the 2 cat idea. Play with it and let us know what you find out :) |
Re: removing quantity
{if $cat eq 500 || $cat eq 451}
this works |
Re: removing quantity
It does indeed! Thanks very much, that's great
|
Re: removing quantity
de nada
|
All times are GMT -8. The time now is 02:52 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.