Show market metafield on product page

I have created a meta field in Shopify, a “market metafield definition” to be precise.

The namespace and key is custom.add_to_cart_button_fact

I would like to display this variable on the product page and add it to the .liquid file.

What must the variable be so that it is displayed? I tried

{{ product.metafields.custom.add_to_cart_button_fact }}

But just blank space was shown.

Of course I gave the variable a text input inside all Shopify markets.

It’s correct.

btw try with value
{{ product.metafields.custom.add_to_cart_button_fact.value }}

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 }}

  1. Are you using it in the product page or somewhere else ?

  2. Instead of this {%- render ‘customer-box’ -%} try to use {{ product.metafields.custom.add_to_cart_button_fact.value }} or {{ product.metafields.custom.add_to_cart_button_fact }} in the same liquid block and let me know but make sure you are in the product template.

  1. I am using it on product pages, I did a triple-check. I have several different product templates, but I made sure I am opening the correct product with the corresponding product template.

  2. I tried both {{ product.metafields.custom.add_to_cart_button_fact.value }} and {{ product.metafields.custom.add_to_cart_button_fact }} in the same liquid block, but still empty although I have an input (see screenshot).

Sounds like shopify provides a different dashboard to you lol
btw if you want you can provide the store access so I can check and let you know what is wrong there.

Please use
{{ localization.market.metafields.custom.add_to_cart_button_fact }}

It will work.

It works! Thank you so much! :clap: