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

removing quantity

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 08-12-2004, 05:34 PM
 
kkrieger kkrieger is offline
 

Newbie
  
Join Date: Aug 2004
Posts: 1
 

Default 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!
__________________
my sig?
Reply With Quote
  #2  
Old 08-13-2004, 11:26 PM
 
twulff twulff is offline
 

Member
  
Join Date: Aug 2004
Posts: 12
 

Default

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?
__________________
Thomas
_______________________
X-Cart version 4.0.2 & xaffiliates
PHP 4.1.2
MySQL 3.23.49
Web server Apache
Operation system Debian Linux 3.0
Perl 5.006001
Reply With Quote
  #3  
Old 08-14-2004, 07:34 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

Just what I was about to say
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #4  
Old 05-20-2008, 12:47 PM
 
coresmart71 coresmart71 is offline
 

Newbie
  
Join Date: Dec 2005
Posts: 5
 

Default 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
__________________
Lisa B.
Coresmart.com

Xcart gold v 4.1.8
Reply With Quote
  #5  
Old 08-12-2008, 08:16 AM
 
jbvideo jbvideo is offline
 

Advanced Member
  
Join Date: Jun 2004
Posts: 73
 

Default 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?
__________________
Sharon
vers. gold 4.0.17 to 4.1.10 (july 2008 )
Reply With Quote
  #6  
Old 08-12-2008, 10:20 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default 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.
__________________
xcart 5.1.2
Reply With Quote
  #7  
Old 08-12-2008, 01:19 PM
 
jbvideo jbvideo is offline
 

Advanced Member
  
Join Date: Jun 2004
Posts: 73
 

Default 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::
__________________
Sharon
vers. gold 4.0.17 to 4.1.10 (july 2008 )
Reply With Quote
  #8  
Old 08-12-2008, 07:19 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default 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>*}
__________________
xcart 5.1.2
Reply With Quote
  #9  
Old 09-07-2008, 10:06 PM
 
wayfarer wayfarer is offline
 

Advanced Member
  
Join Date: Apr 2003
Posts: 56
 

Default 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...
__________________
X Cart Pro
v. 4.1.9
Download Expander (from Altered Cart)
X-Magnifier
Dynamic Preview (from BCS Engineering)
Customer Rewards Points (BCSE), used as credit purchasing system
Reply With Quote
  #10  
Old 09-07-2008, 10:11 PM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: removing quantity

use the same one you used for the drop down. just place it around the qty label.
__________________
xcart 5.1.2
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 10:52 PM.

   

 
X-Cart forums © 2001-2020