Variant metafield in the dynamic sources?

Topic summary

Variant-level metafields cannot be selected as dynamic sources in Online Store 2.0 product templates; only product-level metafields appear. Selecting a specific variant via URL (e.g., ?variant=ID) does not change the dynamic source context, which remains tied to the product object.

Context and reasoning:

  • Dynamic sources are bound to the page’s object (product), and Shopify provides no “variant” input type in sections/theme settings, per official docs. This prevents selecting variant metafields directly in the editor.
  • Ambiguity exists for which variant to reference without a selection mechanism in the theme editor.

Workarounds proposed:

  • Use Liquid to expose variant metafield data and JavaScript to update the DOM on variant change (e.g., in Dawn: loop variants, store metafield values keyed by variant ID, hook into the variant-change handler that updates price, and replace targeted content).
  • An existing event listener for selected variants can drive swapping in the appropriate variant metafield content.

Unresolved points and user needs:

  • Multiple merchants want per-variant content (ingredients, leather descriptions, part numbers, barcodes). Some argue it’s logically needed since only one variant is active at a time.
  • No official solution or editor support surfaced; one user reported escalating to Shopify support and awaiting feedback. The issue remains open.
Summarized with AI on December 14. AI used: gpt-5.

Check this thread https://community.shopify.com/post/1358267

There is already an event listener to check which variant is active.
Now it only needs to display the content of the Variant Metafield variable instead of a fixed text.