Showing posts with label get all disabled products in magento. Show all posts
Showing posts with label get all disabled products in magento. Show all posts

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)