Skip to main content
All CollectionsGetting startedInstallation
Displaying product ratings and review counts with metafields
Displaying product ratings and review counts with metafields
Updated over a week ago

Do you want to showcase a product's average rating and the total number of reviews in a specific location on your store? You can achieve this by using metafields and integrating them into your theme code.

About metafields offers two standard Shopify metafields: reviews.rating (stored as a rating type) and reviews.rating_count (stored as a number_integer type). These metafields provide:

  • {{ }}: This allows you to present the average rating (e.g., "value": "3.5").

  • {{ }}: This enables you to display the number of reviews (e.g., 125).

Additionally, you can access the minimum and maximum values of a product's rating through the scale_min and scale_max values:

  • {{ }}: Use this to showcase the minimum rating value ("scale_min": "1.0").

  • {{ }}: Use this to highlight the maximum rating value ("scale_max": "5.0").

How to integrate metafields into your theme code

To incorporate metafields into your theme code, adhere to these straightforward steps:

  • Go to your Shopify Admin > Online Store > Themes.

  • In your Current theme, click on the Actions button and select Edit Code.

  • Locate the product.liquid file.

  • Insert the necessary code to display your desired metafields.

  • Save your changes and then inspect any product on your store to see the results.

If you encounter any issues or require assistance, don't hesitate to reach out to us at [email protected], and we'll be more than happy to assist you.

Examples of Metafields on Your Live Store

Please note that metafields will return numerical values only. You have the flexibility to add accompanying text to provide context to this information. For instance:

Here's how the metafields are displayed on your live store

This approach allows you to showcase valuable product rating and review information to your customers.

If you need help displaying product ratings and review counts with metafields, contact our team at [email protected]. We're available to help 24/7!

Did this answer your question?