I need to add the quantity of stock in each product
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!
Thank you !
Where is the phtml file located?
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!
I hope you got your answer.