How to Get All Disabled Products in Magento.?

Magento is one of the platform that with which you can easily manage thousands of product. For getting all the disabled products in product Magento Collection the below.


To get all disabled product in Magento you can use model Mage::getModel(‘catalog/product’).

$products = Mage::getModel('catalog/category')->getProductCollection()
->addAttributeToSelect('*')
->addFieldToFilter('status',;Mage_Catalog_Model_Product_Status::STATUS_DISABLED);

This filter when applied will return all inactive and disabled products in your Magento site.

Magento get all disable products in current category

Use below given code if you want to get the disable products in current category.

$categoryId = 134; // a category id that you can get from Admin panel

$collection = Mage::getModel('catalog/product')
->getCollection()
 ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
->addAttributeToSelect('*')
->addAttributeToFilter('status', array('eq' => 2))
 ->addAttributeToFilter('category_id',  array('eq' => $categoryId));

This filter when applied will return all inactive and disabled products in current category Magento.

You may also like...

Leave a Reply

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