Tzu ng
Tzu ng

Reputation: 9244

Apply current category's filter to productCollection

I know that I can get product collection

$collection = Mage::getResourceModel('catalog/product_collection'); .

How can I filter this product collection with categoryId and its filter ?

The filters I'm talking about are filters when we click on layered navigation sidebar ( attribute options ..) .

Upvotes: 0

Views: 376

Answers (1)

Jscti
Jscti

Reputation: 14440

You can use ->addCategoryFilter(Mage::registry('current_category')); on your collection (check if you have a current_cateogry prior to this)

Upvotes: 1

Related Questions