Magento Forum

   
How would I remove the need for the quantity box? 
 
medic
Sr. Member
 
Total Posts:  173
Joined:  2007-10-30
Sydney
 

I don’t need to have the quantity box on my shop.

How would I go about removing it?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
laurent
Member
 
Total Posts:  75
Joined:  2007-08-31
Paris, France
 

If you mean the quantity in the product page, there is 3 templates files depending on product type.
For simple products, the file is app/design/frontend/your_interface/your_theme/template/catalog/product/view/type/simple.phtml

Remove all the <span class="qty-box">[...]</span>

And by the way, for those who want the input box value to be 1 by default instead of nothing:
find:

<input name="qty" type="text" class="input-text qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product) ?>"/>
and replace with:
<input name="qty" type="text" class="input-text qty" id="qty" maxlength="12" value="<?php echo $this->getMinimalQty($_product)? $this->getMinimalQty($_product): 1 ?>"/>

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Enthusiast
 
Avatar
Total Posts:  888
Joined:  2008-04-28
London, UK
 

Note:

This still works. However, the file to modify is now addtocart.phtml and NOT simple.phtml.

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Antonimo
Member
 
Avatar
Total Posts:  51
Joined:  2009-03-26
Sweden
 

This used to work when the quantity was in the separate product types (eg Simple) - Now that it is in addtocart.phtml, this change is global.

Is there a better solution?

 
Magento Community Magento Community
Magento Community
Magento Community
 
CT Schubert
Sr. Member
 
Avatar
Total Posts:  197
Joined:  2008-10-08
Southern California
 

In what scenario would you not need a quantity box? Are all quantities 1 and therefore a qty field is pointless?

Could you not just change the input field from a text type to hidden, thus hiding it w/o removing it, so when you add to cart it still adds 1?

 
Magento Community Magento Community
Magento Community
Magento Community
 
kbiglione
Jr. Member
 
Total Posts:  1
Joined:  2009-07-06
 

Most downloadable product scenarios render the quantity field unnecessary. It would be nice to be able to disable the QTY box by product type.

 
Magento Community Magento Community
Magento Community
Magento Community
 
muzafar
Member
 
Avatar
Total Posts:  60
Joined:  2009-03-28
Lahore
 
lisali - 18 August 2008 06:47 AM

Note:

This still works. However, the file to modify is now addtocart.phtml and NOT simple.phtml.

Thanks!

thanks for guiding. i see late on your post after searching all files related to the products.

Web Development Guide Forum And NetGuidePlus

 
Magento Community Magento Community
Magento Community
Magento Community
 
Cody James
Jr. Member
 
Total Posts:  6
Joined:  2009-10-30
 

Yes, for downloadable products Quantity is not always needed. 

To remove it I replaced the line..
.

<input type="text" class="input-text qty" name="qty" id="qty" maxlength="12" value="<?php /*echo $this->getMinimalQty($_product)*/ ?>" />

With…

<?php if(!$_product->isVirtual()): ?>
<input type="text" class="input-text qty" name="qty" id="qty" maxlength="12" value="<?php /*echo $this->getMinimalQty($_product)*/ ?>" />
<?php endif; ?>

in addtocart.phtml

Works great!

 
Magento Community Magento Community
Magento Community
Magento Community
 
7 uur
Jr. Member
 
Avatar
Total Posts:  23
Joined:  2009-10-08
The Netherlands / Holland
 
Cody James - 23 February 2010 10:00 AM

Yes, for downloadable products Quantity is not always needed. 

To remove it I replaced the line..
.

<input type="text" class="input-text qty" name="qty" id="qty" maxlength="12" value="<?php /*echo $this->getMinimalQty($_product)*/ ?>" />

With…
<?php if(!$_product->isVirtual()): ?>
<input type="text" class="input-text qty" name="qty" id="qty" maxlength="12" value="<?php /*echo $this->getMinimalQty($_product)*/ ?>" />
<?php endif; ?>

in addtocart.phtml

Works great!

i tried to do this, but it didnt work, the box still appeared. Does this only work with downloadable products?, because i need only the virtual products to not show the quantitybox.

i use magento ver. 1.4.1.1 and edited this file: app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml

thx

 
Magento Community Magento Community
Magento Community
Magento Community
 
Philster53142
Member
 
Total Posts:  67
Joined:  2009-10-03
 

How do I remove the quantity field from a bundled product?

It’s silly for customers to select quantities of various items and then be asked how many of those “bundles” they need. Perhaps I’m using bundled products a little bit differently but imagine you are buying towels. You select 1 bath sheet in white, 2 bath towels in blue, and 4 hand towels in blue. Then you are asked at the end how many of that configuration you need? that’s just seems silly. So I want to disable quantity box for bundles only.

I’m still on version 1.3.2.4

 
Magento Community Magento Community
Magento Community
Magento Community
 
MERINEO
Jr. Member
 
Total Posts:  9
Joined:  2010-01-22
 
7 uur - 13 October 2010 05:19 AM

Cody James - 23 February 2010 10:00 AM
Yes, for downloadable products Quantity is not always needed. 

To remove it I replaced the line..
.
<input type="text" class="input-text qty" name="qty" id="qty" maxlength="12" value="<?php /*echo $this->getMinimalQty($_product)*/ ?>" />

With…
<?php if(!$_product->isVirtual()): ?>
<input type="text" class="input-text qty" name="qty" id="qty" maxlength="12" value="<?php /*echo $this->getMinimalQty($_product)*/ ?>" />
<?php endif; ?>

in addtocart.phtml

Works great!

i tried to do this, but it didnt work, the box still appeared. Does this only work with downloadable products?, because i need only the virtual products to not show the quantitybox.

i use magento ver. 1.4.1.1 and edited this file: app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml

thx

Its working for me, i just delete line

<label for="qty"><?php echo $this->__('Qty:'?></label>
, because the quantity box dissapear, but label stays, so now its perfect...smile Im using 1.4.1.1 version of Magento.

Thanks for solution…

MERINEO

 
Magento Community Magento Community
Magento Community
Magento Community
 
ayawlex
Jr. Member
 
Total Posts:  3
Joined:  2011-07-29
 
Philster53142 - 19 October 2010 02:52 PM

How do I remove the quantity field from a bundled product?

It’s silly for customers to select quantities of various items and then be asked how many of those “bundles” they need. Perhaps I’m using bundled products a little bit differently but imagine you are buying towels. You select 1 bath sheet in white, 2 bath towels in blue, and 4 hand towels in blue. Then you are asked at the end how many of that configuration you need? that’s just seems silly. So I want to disable quantity box for bundles only.

I’m still on version 1.3.2.4

anyone knows how to remove the qty box in bundled page?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Robm9000
Jr. Member
 
Total Posts:  3
Joined:  2009-08-15
 
ayawlex - 08 August 2011 08:02 AM

Philster53142 - 19 October 2010 02:52 PM
How do I remove the quantity field from a bundled product?

It’s silly for customers to select quantities of various items and then be asked how many of those “bundles” they need. Perhaps I’m using bundled products a little bit differently but imagine you are buying towels. You select 1 bath sheet in white, 2 bath towels in blue, and 4 hand towels in blue. Then you are asked at the end how many of that configuration you need? that’s just seems silly. So I want to disable quantity box for bundles only.

I’m still on version 1.3.2.4

anyone knows how to remove the qty box in bundled page?

Aside from the addtocart.phtml Qty box - the bundled products have an annoying habit of including additional quantity ‘Qty’ boxes per individual item - To remove them, you can edit any of the various layout components in the following directory:

htdocs/app/design/frontend/base/default/template/bundle/catalog/product/view/type/bundle/option/

To remove the Qty: in a dropdown you would need to edit ‘select.phtml’

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top