Magento – Get Product Stock Quantity


To get the quantity in stock for a particular product in Magento use the following code –

$qtyStock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty();
This entry was posted in Magento, PHP and tagged , . Bookmark the permalink.

3 Responses to Magento – Get Product Stock Quantity

  1. Julec says:

    How to change it, just to show only if quantity is bigger than 0=zero
    Or to show some graphics icon when quantity is >0

  2. kalyan says:

    — here your code if there is available quantity–
    echo “”;


  3. jeeva says:

    where i can add this code

Leave a Reply

Your email address will not be published. Required fields are marked *