1

How to create a collection of all products that have attribute ABC? Can someone please guide me as i am new to Magento?

Then I would like to link that collection to a custom static block using href link? Please provide me step by step approach as i am a newbie.

Appreciate your help.

1 Answer 1

1

You will need to use eq:

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->
    addAttributeToFilter(array(
            array('attribute' => 'code', 'eq' => 'ABC')
                ));

You can find lot of ways in future on THIS POST

1
  • You can place this code wherever you are getting the colection Commented Aug 25, 2014 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.