Global expansion, localizing content, and selling in multiple currencies and languages
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.
Solved! Go to the solution
This is an accepted solution.
Please use
{{ localization.market.metafields.custom.add_to_cart_button_fact }}
It will work.
It's correct.
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.
This is an accepted solution.
Please use
{{ localization.market.metafields.custom.add_to_cart_button_fact }}
It will work.
It works! Thank you so much! 👏
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024