Get product review info (independent) of review page

Here at Inchoo, we are working on a private project, that should see daylight any time soon. One of the requirements we had is to show product review info on pages independent of product review page. Let’s say you wish to show review info on home page for some of the products. After few weeks with working with Magento, one learns how to use the model stuff directly from view files. Although this might not be the “right” way, it’s most definitely the fastest way (and I doubt most of your clients would prefer any other
, especially if it’s some minor modification).
Here is a code to retrieve the product review info:
<?php
$storeId = Mage::app()->getStore()->getId();
$summaryData = Mage::getModel(’review/review_summary’)
->setStoreId($storeId)
->load($_product->getId());
/* @var $summaryData Mage_Review_Model_Review_Summary */
/*
array(
['primary_id'] => 147
['entity_pk_value'] => 166
['entity_type'] => 1
['reviews_count'] => 1
['rating_summary'] => 80
['store_id'] => 1
)
*/
?>
Just be sure to pass it the right product id number. Cheers…
By Branko Ajzele from Inchoo.net
Related posts:

Hi,
It is very nice.
Thanks
Bhargav Anadkar – Dhanashree Inc.
Leave your response!