Discussing APIs and development related to customers, discounts, and order management.
I can change the user location by localization form:
https://shopify.dev/docs/api/liquid/tags/form#form-localization
But this way enforces the user submits the form to set the country.
I want to change user location directly by url parameter, something like this:
It doesn't matter how it finds that particular URL, I just want to set the country that way.
It's possible?
Solved! Go to the solution
This is an accepted solution.
Hi there, yes, it is exactly as you have written: https://help.shopify.com/en/manual/markets/international-domains/directing-customers/deep-links
Cole | Product @Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
This is an accepted solution.
Hi there, yes, it is exactly as you have written: https://help.shopify.com/en/manual/markets/international-domains/directing-customers/deep-links
Cole | Product @Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
This is so **bleep** perfect!
My Product Owner will be very happy lol
Thank you very much.
Hello Cole , we recently implemented this, but when we used the deep links, all our prices that were returned from the Shopify Ajax APIs (Cart, recommended products, predictive search) were shown in the right currency, but default currency amount.
Example: The price displayed in all the components using the APIs after switching to canada in a store that has euro prices as default: 109 CAD (euro value) instead of 160,62 CAD (correct CAD value)
This made every price rendered through liquid correct, but the ones pulled from the API incorrect.
We went away from the deep links because of that to a custom solution using the localization form, but we'd love to use the deep links if the issue was solved. If this worked correctly, we could also switch countries directly and, on top of that, utilize custom URL parameters on the same shop domain and persist parameters across our different shop domains.
Could you please check, if that has happened to anybody else, or have an idea on how to fix this?
Can you DM me with the store and more details around the API call please? I will get this in front of the right people to diagnose
Cole | Product @Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
I've tried to use this with the checkout (Shopify Plus) but it's not working.
?locale=fr-BE is only setting the correct language, not the country.
?country=BE isn't doing anything for me.
Can you help me?
I have issues with the URL parameter for countries, too. This seems to be in combination with language subfolders:
Assume I have Canada (CA) as currently selected country and French as language. Then my URL looks like this: https://my-shop.myshopify.com/fr. When I set the URL parameter to switch the country, like in https://my-shop.myshopify.com/fr?country=BE, the page reloads and correctly shows the new country and currency. But as soon as I don't use the parameter again (like this: https://my-shop.myshopify.com/fr), Canada is shown again. There is no permanent assignment.
This behavior is only shown in a productive/merchant shop and only if I have a language subfolder. In my dev environment or in production with no subfolder (like https://my-shop.myshopify.com), the new country is permanently assigned as soon as I used it once as URL parameter.