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);
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));