I want to display all the product with some product attribute features.

ie; I have 3 products in kids category with attributes and categories like

Category: boy and girl

Size: small, medium,large

color: black,red,white

so I need all the product having Category->boy, Size->small,medium,&color->black,white.

How can it be done?

1 Answer 1


Use below code to filter product collection

$_productCollection = Mage::getModel('catalog/product')
                ->joinField('category_id', 'catalog/category_product', 'category_id', 'product_id = entity_id', null, 'left')
                        array('eq'=> 'small'),
                        array('eq'=> 'medium')
                        array('eq'=> 'black'),
                        array('eq'=> 'white')

Hope it will be helpful to you.

  • your code is not working
    – Sourav
    Mar 18, 2016 at 19:17
  • not getting the products. Mar 19, 2016 at 7:09

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.