Tuesday, 12 May 2015

Filter Product Collection for Multi Select Attribute Option value in Magento

$brandLabel = $_product->getAttributeText('manufacturer');
           
            $option_id = $attr->getSource()->getOptionId($brandLabel);

            $attrcode="manufacturer";

$product_collection=Mage::getModel("catalog/product")->getCollection();
   $product_collection->addAttributeToFilter($attrcode,$option_id);
            foreach($product_collection as $_product){
                $_product = Mage::getModel('catalog/product')->load($_product->getId());
            }

No comments:

Post a Comment