I want to filter the product collection using "Ratings". As it is not an attribute of products how can i do that?

$collection = Mage::getModel('catalog/product')->getCollection()
             ->addAttributeToFilter('type_id', 'configurable')
             ->addAttributeToSort('name', 'asc');

I want to do Ratings filtering for the above collection.

Thanks in advance.


Try this.

$collection = Mage::getModel('catalog/product')->getCollection();
$reviews = Mage::getModel('review/review')

foreach($collection as $product)
    $productId = $product->getId();
    $reviews->addEntityFilter('product', $productId)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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