Guide to display Rating Stars Widget on Magento category and product pages

To display stars and ratings on your category listing page, and the product page, you'll need to edit the following 2 files in your theme. The path of these file

  1. MAGENTO_ROOT_DIRECTORY/app/design/frontend/default/YOUR THEME/template/catalog/product/view.phtml
  2. MAGENTO_ROOT_DIRECTORY/app/design/frontend/default/YOUR THEME/template/catalog/product/list.phtml

Adding rating stars to your products page

Open view.phtml and insert the following snippet to the place you want to see the rating widget to appear on. Usually this would be below the <div class="product-name">. Copy and paste the following snippet:

<div class="rivio-stars-widget" data-rivio-stars-widget-product-id="<?php echo $_product->getId() ?>"></div>

Save your template.


Adding rating stars to your category pages

Open list.phtml and insert the following snippet to the place you want to see the rating widget to appear on.

<div class="rivio-stars-widget" data-rivio-stars-widget-product-id="<?php echo $_product->getId() ?>"></div>

Save your template.

Is this article helpful for you?