Skip to main content

Overview

In V3 Template, products are fetched using GraphQL. While default product data is automatically included, accessing additional metafields requires three steps:
  1. Adding metafields to the getProductDetailsQuery function
  2. Including metafields in the transformProductData function
  3. Accessing the metafields in your template’s theme.liquid

Basic Implementation

Step 1: Modify getProductDetailsQuery

Add your metafields to the GraphQL query in the getProductDetailsQuery function:

Step 2: Update transformProductData

Modify the transformProductData function to include your metafields:

Step 3: Access in Theme

Use the transformed metafield in your theme.liquid:

Practical Example: Product Ratings with Judge.me

Prerequisites

  1. Install Judge.me app on your Shopify store:
    • Go to Shopify App Store and install Judge.me
    • Enable the app integration in your store settings
  2. Enable Judge.me in Glood:
    • Navigate to Glood Product Recommendations
    • Go to Settings >> Integrations >> Product Review Apps
    • Enable the Judge.me app integration
After completing the setup, the rating metafields will be available in your GraphQL queries. You can query these metafields using the reviews namespace wherever needed. To display product ratings in your template, simply use the Judge.me liquid tag: