Engine23

Magento - get the rating

How to get the rating of a product using the review id

$ratingCollection = Mage::getModel('rating/rating_option_vote')->
getResourceCollection()->
setReviewFilter($review->getId())->
setStoreFilter(Mage::app()->getStore()->getId())->
addRatingInfo(Mage::app()->
getStore()->
getId())->
load()->
getItems();
$ratings = array(); foreach($ratingCollection as $item){ $ratings[]=$item->getValue(); }

Share: