Loading
Copy-paste a Liquid snippet for trust & social proof - Shows the product's real review rating from the standard Shopify metafield - no hardcoded numbers. Adapted from a real storefront build.
On a real product the score comes from the reviews metafield - the preview uses the settings on the left.
{%- comment -%} Reads the standard Shopify review metafields (rating + rating_count), which most review apps populate. Renders nothing when there is no data.{%- endcomment -%}{%- assign rating = product.metafields.reviews.rating.value.rating | plus: 0 -%}{%- assign rcount = product.metafields.reviews.rating_count.value | plus: 0 -%}{%- if rating > 0 -%} <div class="gpl-stars" role="img" aria-label="Rated {{ rating }} out of 5 stars"> <span class="gpl-stars__icons" style="--gpl-rating: {{ rating }};" aria-hidden="true">★★★★★</span> <strong class="gpl-stars__score">{{ rating }} / 5</strong> {%- if rcount > 0 -%} <span class="gpl-stars__sep" aria-hidden="true"></span> <span class="gpl-stars__count"><b>{{ rcount }}</b> verified reviews</span> {%- endif -%} </div>{%- endif -%} {% stylesheet %}.gpl-stars { display: inline-flex; align-items: center; gap: 0.9rem; padding: 0.65rem 1.35rem; border-radius: 999px; background: rgba(15, 24, 44, 0.92); border: 1px solid rgb(255 215 0 / 0.3); box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgb(255 255 255 / 0.08); color: #fff;}.gpl-stars__icons { position: relative; display: inline-block; color: #3d4a66; letter-spacing: 0.12em; font-size: 1rem; line-height: 1; }.gpl-stars__icons::before { content: "\2605\2605\2605\2605\2605"; position: absolute; left: 0; top: 0; width: calc(var(--gpl-rating) / 5 * 100%); overflow: hidden; white-space: nowrap; color: #ffb800; text-shadow: 0 0 10px rgb(255 184 0 / 0.4);}.gpl-stars__score { font-size: 0.9rem; }.gpl-stars__sep { width: 1px; height: 1rem; background: rgb(255 255 255 / 0.2); }.gpl-stars__count { color: #94a3b8; font-size: 0.8rem; }.gpl-stars__count b { color: #5eead4; font-weight: 700; }{% endstylesheet %} Usage
{% render 'star-rating', product: product %}