Using Managed Markets to sell and fulfill internationally
I have two different stores. One for NL (Netherlands) and one for DE (Germany). Both stores have only 1 market. First one Netherlands and the other Germany. Now I notice that if I check the market handle by doing:
<script>console.log({{ localization.market.handle | json }})</script>
(because it's the only way I found to check market handle)
the Dutch handle is 'nl', which stands for Netherlands. That is exactly what I want, but the German handle is not 'de', it is like 3e93e378-18c4-485f-b7be-9f58cc5b7522.
What is the reason for the Germany market to have such a handle? Is there a way to change/avoid it? It is quite important for using context templates (Even though I could use the long handle, I still would like to change this, because I work in a company with multiple developers).
Have you tried localization.country.iso_code?
Or localization.language.iso_code?
Or shop.address.country_code?
Whichever better reflects the data you need...
Because market is not always a single country.
Thank you for replying!
It isn't really about the way of getting the right code, it is specifically about the market handle, because to use different templates in different markets you need to have a second json file with the market handle in it. So for index.json, you need a index.context.*handle*.json. And I only use one market in the store. With the dutch store it does show 'nl', but the german doesn't show 'de' and the settings are the exact same.
Aah, I see.
The reason could be if you've modified and re-created your market.
Technically, you should be able to change the handle with GraphQL at least -- https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/marketUpdate
Not sure if you'd need to update your theme templates then.
Thank you for your answer! So I've seen people say that you can change the market handle, but I don't see the feature you are describing to edit market.
It's like your second screenshot, but market must not be primary:
So, create new market, swap them, modify Germany and swap back?
Or, use GraphQL -- just tried and was able to modify primary market. Note that existing filenames in theme would not change automatically.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025