Magento – Display Quantity Box on Product View Page

addtocartextensionsproduct-view

we saw "quantity" box in our product view page before

now Quantity box is missing in product view page after a lot of customizations in view.phtml and after installing some extensions.

before addto cart.phtml is calling from theme.

app/design/frontend/default/theme_name/template/catalog/product/addtocart.phtml

now the quantity box is calling from some extension files.

app/design/frontend/default/default/template/extension_name/catalog/product/view/addtocart.phtml

this is our addtocart.phtml = http://pastebin.com/ZNyvyzQ9

now, what I should do to display only the quantity box on the product page.

Best Answer

Open:

/app/design/frontend/default/YOURTHEME/template/catalog/product/view.phtml

Add this:

<?php if ($_product->isAvailable()): ?>
    <p class="availability in-stock"><?php echo $this->__('Qty Available:') ?> <span><!--<?php echo $this->__('In stock') ?>--><?= (int) Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()?></span></p>
<?php else: ?>
    <p class="availability out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>

I hope this is what you are looking for :)

Related Topic