Magento getting amount(qty) of a product


/ Published in: PHP
Save to your folder(s)

this snippet of code is getting the qty of product in magento


Copy this code and paste it in your HTML
  1. //if you have a product item model you can use that
  2.  
  3. echo $product->getQty();
  4.  
  5. //or you can use that for getting qty
  6. $product_stock_count = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
  7.  
  8. echo $product_stock_count;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.