Hydrogen with EU as secondary market missing country code

Hi,
I am setting up the European Market as secondary market with subfolder structure. Three languages are installed and setup.

I added eu as ending/country string in the market setup. If I open up my domain with ###.com/en-eu the GraphQL fails as EU no known country code. In Liquid with the default theme it works.

I extended the country codes but it did not work.

Is there no way of using eu as meta market for the additional countries? Do I have to add then the countries manually? Is this the intended behaviour as opposed to the liquid themes?

Any help on this topic would be nice. Thanks!!

1 Like

Hey @Michael_Hildenbrand - hopefully I’m understanding correctly here, but are you looking at implementing localization within Hydrogen through the Storefront API?

If so, a Hydrogen shop uses the Storefront API to return the correct localized pricing, product availability, duties, etc.

This context is usually provided using the @inContext directive in the SFAPI query and relies on the standardized ISO country codes defined in the CountryCode enums here: CountryCode - Storefront API

This is why the “eu” suffix isn’t working, since unfortunately, the SFAPI only accepts the ISO country code enum values. There’s a bit more info here in our dev docs on Hydrogen localization that might help as well: Building localized experiences with the Storefront API and Shopify Markets

Looking at our available country codes, though, it does look like the EU is not set up as a selectable country locale, Using the available ISO codes should resolve the issue, but like you mentioned you would have to set up each country separately. Right now, it looks like what you’re seeing is expected behaviour, but I’ll do some more digging into this to see if it is intended and loop back with you here once I have more info.

Hi,

it is not specifically about localization (but because of context it is needed). It just about the market implementation.

In liquid themes you can use EU as market and fr-eu get’S in the queries correctly resolved.

With hydrogen eu is not available and of course the GraphQL Query fails.

At the moment I added it differently, as I can select more than one country for the markets. In the eu we have one price for delivery and taxes get calculated accordingly.

So I just use another country ISO code for the market and additional ones for the target country. Which should be then quite similar to the EU markets in Liquid stores.

Thx for your feedback

Greetings

1 Like