In my requirement, I have a review id with me by using that, I am getting complete information of that specific review by using the following code:
$review = Mage::getModel('review/review')->load($reviewId);
The above code is giving complete information but not just ratings. When I did Mage::log($review->getData())
, I can see the following information which is clearly showing absence of ratings
.
(
[review_id] => 676
[created_at] => 2014-01-31 15:19:24
[entity_id] => 1
[entity_pk_value] => 669
[status_id] => 1
[detail_id] => 675
[store_id] => 1
[title] => [email protected]
[location] => Hulk mania
[view_type] => 1
[detail] => Hulk smash
[nickname] => Hulk
[customer_id] =>
[course] =>
[ystart] => 0
[yend] => 0
[stores] => Array
(
[0] => 0
[1] => 1
)
)
Please help
EDIT: I tried this which is giving all the three rating values but I was looking for percentage. and even the code is bigger and seems to be degrading performance.
$review = Mage::getModel('review/review')
->load($reviewId);
$data = $review->getData();
$votes = Mage::getModel('rating/rating_option_vote')
->getResourceCollection()
->setEntityPkFilter($data['entity_pk_value'])
->addFilter('review_id', $reviewId)
// ->setStoreFilter(Mage::app()->getStore()->getId())
->load();