Saturday 31 October 2015

List all or get all enabled or disabled products in magento

Lets look at query to get disabled product or enabled products collection in magento

to get list of enabled products use following query

$productsCollection = Mage::getModel('catalog/product')->getCollection()
                    ->addAttributeToFilter('status', 1)


to get list of disabled products use following query

$productsCollection = Mage::getModel('catalog/product')->getCollection()
                    ->addAttributeToFilter('status', 2)

No comments:

Post a Comment