Tuesday 17 March 2015

How to add custom filters on the category page in Magento

Directory file path:   app/code/core/Mage/Catalog/Model/Category.php




public function getProductCollection()
    {
        $collection = Mage::getResourceModel('catalog/product_collection')
            ->setStoreId($this->getStoreId())
            ->addCategoryFilter($this)
->addAttributeToFilter('featured', array('value'=>'1'));
        return $collection;
    }

2 comments:

  1. Really wanted to know about the custom filters and I was looking desperately for this kind of posts. Thanks for such a great post, and keep updated.
    ferric citrate capsules

    ReplyDelete