Magento get out of stock products


Magento get out of stock products : Mage::getModel(‘cataloginventory/stock_item’) is used to get the out of stock product in magento. You can add the filter to get the out of stock items. Here we are going to explain the method to get the out of stock items.


Magento get out of stock products

Here is syntax to get the out of stock items in magento –

Magento get out of stock products

$outOfStockProducts = Mage::getModel('cataloginventory/stock_item')
        ->getCollection()
        ->addFieldToFilter('is_in_stock', 0);

The above collection will give you the out of stock items.


Advertisements

Add Comment

📖 Read More