What's your biggest current challenge? Have your say in Community Polls along the right column.

Show Metafield For Specific Country

Show Metafield For Specific Country

koryb841
Tourist
4 0 1

I would like to create Metafield data (shipping information) that would only apply to specific countries. I would like this to appear on our Product pages. Is there a way to show/hide Metafield content based upon the built-in Currency selection? As an example, if the Currency selector is set to USD the content would appear, but if it is selected to EUR it would not?

 

I could then create multiple Metafields to show different shipping information for USD vs. EUR.

 

Thank you in advance.

Replies 3 (3)

Guleria
Shopify Partner
3692 741 1039

Hello @koryb841 ,

 

Yes possible, try to check what you will get with this variable
{{ currency }}
I think it will return USD when UDS is elected and Euro when EUR selected.

Now based on this you can build your logic to display metafields based on currency.

 

If problem solved don't forget to Like it and Mark it as Solution!
And if you need help with customization/code part you can contact me for services

You can find the email in the signature below.

 

Thanks

- Drop an email   if you are looking for quick fix or any customization
- Email: guleriathakur43@gmail.com Skype: live:navrocks1
- Try GEMPAGES a great page builder

Mehran_Ali
Shopify Partner
448 57 69

Hi @koryb841 

 

You can achieve this using a simple if condition in your product.liquid file 

Something like this 

{% if current_currency == "USD" %}
        {{ product.metafields.custom.shipping_info }}
    {% endif %}

 

I am not sure that the exact code work so just try it if id worked for you otherwise if you can charge you collaboration code I will be happy to help you 

 

-If this solution helps you, kindly LIKE THIS REPLY and MARK AS A SOLUTION OR

Buying Me A Coffee.

-If you need an expert Shopify developer for customization and development, feel free to contact me.


Email: Mehran.ali5300@gmail.com


WhatsApp: +92 343 0211536

gr_trading
Shopify Partner
1973 146 205

Hi @koryb841 ,

 

You can implement this by validating the market id and write code which will check appropriate metafield value.

 

Hope this will helps...

For any custom development WhatsApp or connect at Email ID: gr.trading15@gmail.com for quick consultation. | Shopify Free codes
To support Buy Me a Coffee