Home » Magento Guide

Get product review info (independent) of review page

17 October 2009 One Comment

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:

  1. Get Product for a Specific Store in Magento
  2. Some custom Blocks to help you show products
  3. Custom category menu navigation in Magento
  4. Magento Menu Customization with Product List
  5. Magento, products on sale

One Comment »

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam Protection by WP-SpamFree

Security Code: