I am new in Magento i want to filter product on the basis of attribute such as year, make, model so how can it will done.

on home page i call one template file i.e filter.phtml

In this file i create simple form for filter product from its attribute year: to get year i call block method $this->getYear() in year dropdown list. like wise for model and make. On form action i called controller as Mage::getUrl('ymm/index/filter'). So now i am getting post data in block using getRequest()->getPost() or getParam() mothod.
So now my question is how can we filter product on the basis of post data attribute?

Thanks for reply...........

1 Answer 1


Use addAttributeToFilter


hope this helps

  • 1
    Your answer should contain more detail.
    – benmarks
    Jul 28, 2013 at 12:53

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.