Articles on: Installing widgets on store

How to add stars widget through code? (with no add block)

Watch out for new updates to Shopify themes. It is possible that your classic theme has become a 2.0 theme. So follow the 2.0 theme steps if necessary.

Go to your Shopify Themes menu. (online store -> Themes)
Click on the "Actions" menu, then select "Edit Code".
Open the section you use for product pages (usually this is called product-template.liquid or product.liquid, but some themes work differently).
Copy the line of code below:
Paste it where you want the stars to appear on the product page (we recommend pasting the code under the product title), then save your file.

<a href="#trustreviewsFrame"><div class="trustreviews-rating" data-id="{{ product.id }}" data-rating="{{ product.metafields.trustreviews.avg_rating }}" data-raters="{{ product.metafields.trustreviews.num_reviews }}"></div></a>


Here is an example on the Debut theme:





Updated on: 03/13/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!