GQL - Cart initialization and localization #46
-
Hello, I'm trying out Swell and have run into two things I can't seem to work out and would love some input. No 1: Creating a cartI've been checking out this guide https://developers.swell.is/frontend-api/basic-usage. So I create an empty cart with:
The Now I want to add to this session, by utilizing:
Headers are now No 2: Locales and currenciesI have
This adds the product fine, but returns the cart in the default locale and with the "wrong" price (in base currency) and the currency node as null - regardless of which of my locales and currencies I provide. When getting the cart:
When getting the cart I'm able to get the locale kicking in, but currency is still null - and the price is "wrong" (in the base currency, not adjusted). Am I misunderstanding how the locales/currencies work? Any help appreciated! Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Hi, @henke-89 On the first topic, yes, that is expected. Our session is a "stateful session", which means some requests can mutate its values and it is safer to sync your local storage with the most recent session coming from requests to Swell. For example, things like locale and currency can be stored in session and change the session value. |
Beta Was this translation helpful? Give feedback.
-
As for the second topic, we actually found a bug preventing those query params to be passed in some requests. We have a fix coming up soon, thank you for the heads up! |
Beta Was this translation helpful? Give feedback.
Hi, @henke-89
On the first topic, yes, that is expected. Our session is a "stateful session", which means some requests can mutate its values and it is safer to sync your local storage with the most recent session coming from requests to Swell. For example, things like locale and currency can be stored in session and change the session value.