I was looking for a solution to put the star rating element of a product in Magento on any given location. As most of you know, you can simply display the star rating element of a product (you know, the one with the five stars on a row) on a template like a product detail page or product list. But what if you have a product displayed elsewhere else and you just need to display the five stars without having access to the
Inchoo already covered an interesting article about how to get the summary information anywhere, but I am solely interested in the five-star element. So, how can we achieve this? Well, here is how:
$reviewHelper = $this->getLayout()->createBlock('review/helper');
echo $reviewHelper->getSummaryHtml($loaded_product, 'short', false);
Easy isn’t it?
Visitors give this article an average rating of -8,399.8 out of 5.
How would you rate this article?
★ ★ ★ ★ ★