Skip to content
Moodboard Creations
  • Themes
  • Partner programme
Support
← Journal

How to add a metafield to the Chart block

Use a product metafield to drive Vincent's Chart block, so rating values live on the product instead of being set by hand in every template.

Published
December 2024
Applies to
Vincent theme →
Need help?
Contact support

If you are looking to streamline the process of adding multiple chart blocks to your product pages, using metafields can save time by centralising product-specific values.

For general guidance on creating and managing metafields in Shopify, refer to the official Shopify documentation.

Why use metafields for the Chart block?

On product pages, adding multiple chart blocks manually can be time-consuming. By linking product-specific values to metafields, you can reduce repetitive work and manage data more efficiently.

Step 1: Add a metafield definition for the Chart block

  1. From your Shopify admin, navigate to Settings > Custom data > Products.
  2. Click Add definition to create a new metafield definition.
  3. Enter a name for the metafield (for example "Chart value") and set the type to Integer.
  4. Under Validation, set the minimum value to 1 and the maximum value to 5.
  5. Click Save.
Metafield definition for the Chart block with an integer type and a 1 to 5 validation range.

Step 2: Link the metafield to a product

  1. In your Shopify admin, go to Products and select the product you want to update.
  2. Scroll down to the Metafields section.
  3. Enter a value between 1 and 5 in the field for the newly created metafield.
  4. Click Save.
A product's Metafields section with a chart value entered.

Step 3: Connect the metafield to the product template

  1. From your Shopify admin, go to Online Store > Themes.
  2. Select the Vincent theme and open the Products template.
  3. In the Chart block under the Product information section, click the Connect dynamic source button next to Rating (Metafield).
  4. Select the newly created chart metafield. Make sure the product has a metafield value set so the change is visible.
  5. Click Save.
Connecting the Rating setting of the Chart block to the metafield through the dynamic source picker.

Testing your setup

Once all three steps are complete, test your product page to ensure the chart blocks display as expected. Below is an example of a properly configured chart block:

A product page showing chart blocks driven by the metafield value.

Notes

  • Ensure each product has a valid metafield value set to reflect the changes on the product page.
  • Metafields offer flexibility and reduce manual effort, especially when dealing with repetitive data across multiple products.
← How to add a metafield to the Country block
Moodboard Creations

Shopify themes, designed with intent.

Explore

  • Themes
  • Partner programme

Support

  • Contact support
  • Vincent documentation
  • Agnes documentation

© 2026 Moodboard Creations. All rights reserved.

  • Support policy
  • Refund policy