Magento: Display default Add to cart quantity
Posted by admin in Magento
On product page the add to cart quantity field is empty, but I would like to display quantity value 1 or minimal add to quantity value.
Open file: /app/design/frontend/darila/darila/template/catalog/product/view/addtocart.phtml and find line
<input name=”qty” class=”input-text qty” id=”qty” maxlength=”12″ value=”<?php echo $this->getMinimalQty($_product) ?>” type=”text” />
and replace it with:
<input name=”qty” class=”input-text qty” id=”qty” maxlength=”12″ value=”<?php if($_product->isSaleable()): ?><?php echo $this->getMinimalQty($_product)== null?1:$this->getMinimalQty($_product) ?><?php else: ?><?php echo $this->getMinimalQty($_product)== null?0:$this->getMinimalQty($_product) ?><?php endif; ?>” type=”text” />



Interesting post.
I’m looking for a way to add the quantity field on the product listing. Do you know how to do that ?