Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

theme-cart - Product translations #126

Open
brechtwaeghe opened this issue Jul 17, 2020 · 1 comment
Open

theme-cart - Product translations #126

brechtwaeghe opened this issue Jul 17, 2020 · 1 comment

Comments

@brechtwaeghe
Copy link

At the moment the request to the cart.js doesn't fetch the translated content of the products such as the title.
Would it be possible to prefix the request url with the current root url?

For example when you translate your shop to French the root url will be /fr.
The ajax request to /cart.js fetches the products in the default language.
The products will be translated when you change the request to /fr/cart.js.

As a side note this should be mentioned in the docs as well:
https://shopify.dev/docs/themes/ajax-api/reference/cart

@nikitaourazbaev
Copy link

We’ve implemented this in our theme by setting the current cart routes on a global theme object in theme.liquid and reading them in this script, like this:

https://gist.github.com/nikitaourazbaev/134aba47ab10cf373487ae090ea25545

Not sure if it’s too specific a solution, happy to open a PR if this is fine.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants