Products specific for a market not showing up in cart

Topic summary

A user encountered an issue where German market-specific products displayed correctly on collection pages but couldn’t be added to the cart on a Shopify store using Hydrogen Storefront.

Root Cause Identified:
The Hydrogen dev team discovered that while buyerIdentity.countryCode was set to DE (Germany), cart mutation requests were sending an @inContext directive with country code NL (Netherlands) instead. This mismatch prevented market-specific products from being added to the cart.

Resolution:
Adding the country variable to the mutation query resolved the issue. The user confirmed this fix worked.

Additional Finding:
The latest Hydrogen package update is missing the country variable in the addCartLines mutation. The correct implementation should be:

  • await cart.addLines(inputs.lines, {country: countryCode})

This appears to be a bug in the Hydrogen Storefront template affecting multi-market implementations.

Summarized with AI on November 15. AI used: claude-sonnet-4-5-20250929.

We have 2 markets, Primary and German. The German market has specific products which are not available in the Primary market. Switching from the primary market to the German market works fine and the German specific products show up in the collection page. However we are unable to add one of those products to the cart.

The collection where this problem occurs: https://naifcare.nl/de-de/collections/baby-und-kinder

To demonstrate, we can add products that are available across all markets: https://naifcare.nl/de-de/collections/schwangerschaft

Also made a video using a fresh installation of the Hydrogen Storefront template which seems to have the same problem: https://www.loom.com/share/0f4b7c3a9b7145719f01c86e42a3d0d1?sid=356702ea-8517-4e2e-ba54-e2b8829a10aa

Anyone knows how to fix this? or is this a problem only Shopify can fix.

Hi Mweterings,

That is indeed strange behaviour - I’m experiencing the same when I try to add products to carts on your store, so I don’t believe it’s browser related. I’ve connected with the Hydrogen dev team here to see if they can provide any additional troubleshooting suggestions. Will report back asap!

1 Like

Hi Liam, any news from the Hydrogen dev team?

Hi again Mweterings,

We’ve taken a deeper look at this and, while buyerIdentity.countryCode was initially set to DE, all cart mutation requests are sending an @inContext directive country of NL on the Storefront API cart mutation requests.

Can you check your cart route and validate what country context your passing the cart handler as it seems by default to be NL even though product queries are being made in a German context.

Hi Liam,
Thanks so much for checking.

I just added the country as variable to the mutation query, this seems to fix the problem. :grinning_face:

Just to report: the latest update of the Hydrogen package is missing the country variable in the addLines mutation.

await cart.addLines(inputs.lines); Should be: await cart.addLines(inputs.lines, {country: countryCode});