Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cart doesn't use default Hydrogen localisation #622

Closed
Ben4944 opened this issue Sep 1, 2022 · 9 comments · Fixed by Shopify/hydrogen-v1#2521, #980 or Shopify/hydrogen-v1#2519
Closed
Assignees
Labels
Bug Something isn't working @shopify/hydrogen-react

Comments

@Ben4944
Copy link

Ben4944 commented Sep 1, 2022

Describe the bug
The CartProvider localisation defaults to US instead of using the project default from Hydrogen config. Only when on the default site, i.e. not /nz, etc.

To Reproduce

  1. Start demo store
  2. Change defaultCountryCode in Hydrogen config to anything but US
  3. See that this isn't reflected in the cart prices

Expected behaviour
Cart country (currency) should be same as that defined in hydrogen.config.ts.

  • Hydrogen version (1.3.1)
  • Node version (16.15.1)
@Ben4944 Ben4944 added the Bug Something isn't working label Sep 1, 2022
@frehner
Copy link
Contributor

frehner commented Oct 5, 2022

@lordofthecactus is this fixed in CartV2?

@juanpprieto
Copy link
Contributor

@lordofthecactus is this fixed in CartV2?

I believe it is

@lordofthecactus
Copy link
Contributor

It is not fixed. I'm wondering if it makes sense to fix since CartProvider will be independent of hydrogen and it's up to the developer to set the right country for the CartProvider

@frehner
Copy link
Contributor

frehner commented Feb 14, 2023

Shopify/hydrogen-react#42 is another request for this.

[edit: accidentally closed this. Sorry!]

@frehner frehner closed this as completed Feb 14, 2023
@frehner frehner reopened this Feb 14, 2023
@frehner frehner transferred this issue from Shopify/hydrogen-react Mar 3, 2023
@danielmcg1993
Copy link

Hey all 👋

The merchant who originally reported this issue has reached out again - sheertexsheers

As a result of this problem, the cart elements are consistently being displayed in English, irrespective of the language selected by the user. This language mismatch is impacting the user experience and would greatly appreciate help in resolving this issue.

Internal Dashboard
Zendesk Ticket

@blittle blittle self-assigned this Jun 5, 2023
@blittle
Copy link
Contributor

blittle commented Jun 5, 2023

I'm looking into this.

@danielmcg1993
Copy link

Hey all 👋

Thanks for the work carried out here, the merchant responded with the following soon after making them aware of the fix.

Thank you for your email and for addressing the issues we've been experiencing with the "languageCode" in the GQL cart fragment query. I appreciate your efforts in bringing this matter to the attention of the developers and ensuring it was revisited.

However, upon reviewing the pull request that Shopify merged to address the problem (#980), it seems that the solution implemented does not align with our requirements. The update no longer requires a country code to be set in the cart and instead pulls the default country code from the "ShopifyProvider" component.

Unfortunately, this does not resolve our language issue since we offer multiple languages within our Shopify storefront, even though the Shopify country code is set to "US." We need a solution that allows us to display the cart elements in the selected language, regardless of the country code.

While it is now possible to add or remove the countryCode in our cart fragment without any issues, there is still no way to set different languageCodes within the same country code. As a side note it is already possible to set this for various parts of our site, such as product detail pages (PDPs), product listing pages (PLPs), and other pages - just not the cart.

We greatly appreciate the work that the developers have put into finding a resolution, and we understand the complexity of the task. However, we kindly request further assistance in finding a solution that aligns with our specific requirements. It is crucial for our customers to have a consistent and localized experience, with cart elements displayed in the selected language, regardless of the country code.

Thank you for your understanding and support throughout this process. We look forward to hearing back from you soon.

They also added in a separate email the following query -

I forgot to ask, is there any news on localizing the checkout flow ?

@danielmcg1993 danielmcg1993 reopened this Jun 12, 2023
@blittle
Copy link
Contributor

blittle commented Jun 12, 2023

@danielmcg1993 this is probably a new issue. The previous issue was Hydrogen was forcing the default country code. That has now been fixed. The cart itself was not built to handle languageCode. I'm going back to find context as to why that was the case. But it's probably a separate issue add languageCode functionality.

@blittle
Copy link
Contributor

blittle commented Aug 2, 2023

@danielmcg1993 languageCode is now available on 1.7.1 - https://github.com/Shopify/hydrogen-v1/releases/tag/%40shopify%2Fhydrogen%401.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment