Rohit Goel
Rohit Goel

Reputation: 3554

Filter products data in magento

I need to migrate only active products i am using the below code to get all product collection

Mage::getModel('catalog/product')->getCollection(); 

can anybody tell me how can i filter only status = enabled form above code

Upvotes: 0

Views: 129

Answers (1)

Oleg Ishenko
Oleg Ishenko

Reputation: 2233

try

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

Upvotes: 1

Related Questions