Magento: How to get product rating and review?
Here is the code to get ratings and reviews for any particular product. /** * Getting reviews collection object */ $productId = $product->getId(); $reviews = Mage::getModel('review/review') ->getResourceCollection() ->addStoreFilter(Mage::app()->getStore()->getId()) ->addEntityFilter('product', $productId) ->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED) ->setDateOrder() ->addRateVotes(); /** * Getting average of ratings/reviews */ $avg = 0; $ratings = array(); if (count($reviews) > 0) { foreach ($reviews->getItems() as $review) … Read more