How to get out of stock product in Magento with Inventory?

If you want to get out of stock product in magento please follow this code to get out of stock product with inventory. With this code programmatically values will be shown that fetches the right information right away.

Magento get out of stock product

$outOfStockProducts = Mage::getModel('catalog/stock_item')
->getCollection()
->addFieldToFilter('is_in_stock', 0);
->addFieldToFilter('qty', array("gt" => 0));

Above given code will give you all out of stock product with inventory from the products database.

You may also like...

Leave a Reply

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