Skip to main content
All CollectionsTrust Reviews
How to add stars widget through code? (with no add block)
How to add stars widget through code? (with no add block)
Shahroz Qureshi avatar
Written by Shahroz Qureshi
Updated over 8 months ago

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.

1- Go to your Shopify Themes menu. (online store -> Themes)
2- Click on the "Actions" menu, then select "Edit Code".
3- Open the section you use for product pages (usually this is called product-template.liquid or product.liquid, but some themes work differently).
4- Copy the line of code below:
5- 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:


Did this answer your question?