Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
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.
Solved! Go to the solution
This is an accepted solution.
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.
Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog
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!
Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog
Hi Liam, any news from the Hydrogen dev team?
This is an accepted solution.
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.
Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog
Hi Liam,
Thanks so much for checking.
I just added the country as variable to the mutation query, this seems to fix the problem. 😀
Just to report: the latest update of the Hydrogen package is missing the country variable in the addLines mutation.