cancel
Showing results for 
Search instead for 
Did you mean: 

How to add stock quantity on the product sheet?

Highlighted

How to add stock quantity on the product sheet?

I need to add the quantity of stock in each product

3 REPLIES 3
Highlighted

Re: How to add stock quantity on the product sheet?

Hi @asistemasg3830 ,

 

Please try the below code in your phtml file to get the stock quantity of the product.

$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product);

echo $stock->getQty();
echo $stock->getMinQty();
echo $stock->getMinSaleQty();

 

Hope this helps you!

Problem Solved! Click Kudos & Accept as Solution! 

Highlighted

Re: How to add stock quantity on the product sheet?

Thank you !
Where is the phtml file located?

Highlighted

Re: How to add stock quantity on the product sheet?

Hi @asistemasg3830 ,

 

According to Vanilla Magento, your phtml file path should be like this which is rendering on the product page to show the data.

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

 

if you are using some third-party theme, then you need to check the same PHTML in your theme.

 

Hope this helps you!

Problem Solved! Click Kudos & Accept as Solution!