Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to change in stock to number
 
iftekhar123
Jr. Member
 
Total Posts:  2
Joined:  2013-01-28
 

v 1.7 Put this code in template/catalog/product/view/type/default.phtml

<p class="availability in-stock"><?php echo $this->__('Availability:') ?>

<?php $__sharfu = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty(); ?>
<? echo $this->__("$__sharfu"); ?>

<span><?php echo $this->__('In stock') ?></span></p>

 
Magento Community Magento Community
Magento Community
Magento Community
 
ec0mmerce
Sr. Member
 
Avatar
Total Posts:  242
Joined:  2013-01-17
 

Paste the following code here: template/catalog/product/view/type/default.phtml

<?php /* @var $this Mage_Catalog_Block_Product_View_Abstract */?>
<?php $_product = $this->getProduct() ?>

<?php if ($_product->isAvailable()): ?>
<?php $qTy = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty(); ?>
<p class="availability in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__($qTy) ?></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; ?>
<?php echo $this->getChildHtml('product_type_data_extra') ?>
<?php echo $this->getPriceHtml($_product) ?>

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