Tuesday, 26 November 2013

Product collection filter by attribute value

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

 $productCollection->addAttributeToFilter('color', 4);

For example   attribute code  ="color"
                           Red (value id) ="4"

No comments:

Post a Comment