Show market metafield on product page

Topic summary

Goal: Display a Shopify metafield on the product page; the metafield was created as a Market metafield (not a Product metafield) with namespace/key custom.add_to_cart_button_fact.

Attempts: Used product.metafields.custom.add_to_cart_button_fact and the .value variant inside a snippet rendered on the product template. Both returned blank, even when placed directly in the product template’s liquid block.

Diagnosis: The metafield is defined at the Market level, so it isn’t accessible via product.metafields. It must be referenced through the current market context.

Resolution: Use the market-scoped path:

  • {{ localization.market.metafields.custom.add_to_cart_button_fact }}
    This displayed the value correctly.

Notes: Screenshots showed the metafield populated and the snippet included with {%- render ‘customer-box’ -%}. Images were supportive but not essential to the solution.

Status: Resolved; correct access is via localization.market for Market metafields, not product.metafields.

Summarized with AI on December 24. AI used: gpt-5.

Thanks Guleria for your kind response, but I still get just a blank space.

Maybe the issue is somewhere else. I put the code into the liquid file.

The liquid file is inserted by the command {%- render ‘customer-box’ -%} via a custom liquid with the theme editor.

So far it is working with just HTML, but not with {{ product.metafields.custom.add_to_cart_button_fact.value }} or {{ product.metafields.custom.add_to_cart_button_fact }}