Sunday, July 8, 2012

How to display average ratings of product in magento?


public function fnGetTotalProductReview($objCurrentProduct)
{
$objReview = Mage::getModel('review/review');
return $objReview ->getTotalReviews($objCurrentProduct->getId(),true);
}
$intTotalReviewPerProduct = fnGetTotalProductReview($_product);
if($intTotalReviewPerProduct > 0){echo $this ->getLayout() ->createBlock('catalog/product_list') ->getReviewsSummaryHtml($_product);
}

No comments:

Post a Comment

Please mention your comments.......