I need to show star rating list in Layered Navigation in magento1.9 and also need to add custom filter function in layered navigation like Magento default filter functionality.So, before that, I want to know how to get product count by rating collection, by which it will be easy to show product count besides each Star Rating in Rating list. If any one knows about it, please reply back. Thank You

1 Answer 1


for rating count in layered navigation it will count the number of rating of product is above 80 and less then equal too 100. hope you will find the solution..

 protected function _getCount()
    // Clone the select

   $select = clone $this->getLayer()->getProductCollection();


 $products = Mage::getModel('catalog/product')->getCollection()
               array('entity_type'=>1, 'store_id'=> Mage::app()->getStore()->getId()),

            ->addAttributeToFilter('entity_id', array('in' => $pid1))
            ->addAttributeToFilter('rating_summary', array('lteq' => $var))
            ->addAttributeToFilter('rating_summary', array('gt' => $secondvalue))->load();

    return count($products);


Your Answer

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

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