I want to put review and rating widget for products, I want to put review plugin for pages and article ,

How can I do this?



Please try with this custom phtml file.

$reviewSummary = Mage::getModel('review/review_summary');
$storeStructure = Mage::getSingleton('adminhtml/system_store')->getStoresStructure();
$productId = $this->getProduct()->getId();
$avgRating = 0;
$cumulativeRating = 0;
$storesWithRatings = 0;
foreach($storeStructure as $websiteStructure){
    foreach($websiteStructure[children] as $storeInfo){
        $storeID = $storeInfo[value];
        $currentRating = $reviewSummary->setStoreId($storeID)->load($productId)->getRatingSummary();
        if ($currentRating) {
        $cumulativeRating = $cumulativeRating + $currentRating;

if ($cumulativeRating && $storesWithRatings) {
    $avgRating = $cumulativeRating / $storesWithRatings;
<div class="ratings">
    <?php if ($avgRating):?>
        <div class="rating-box">
            <div class="rating" style="width:<?php echo $avgRating ?>%"></div>
    <?php endif;?>

I hope its work for you.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.