Reputation: 1
We have implemented multisite configuration recently, but facing an issue after it. When we have it configured (in both mode - Static/Dynamic configuration), we are getting error in cart API when refreshing the page. After analyzing it we found that it is happening due to wrong site context parameter(currency code) and it is happening only in case of non SSR build, when we use SSR it works fine. In case of normal build, it is adding “USD” as currency code in API call with dynamic site binding and if we are using static binding then it is picking the first currency code even if we are on secondary website. Spartacus framework is picking it from default list of currency codes when hitting cart API on page refresh.
Spartacus version:2.0
Please share a solution on this.
Upvotes: 0
Views: 256
Reputation: 119
You can add currency
in static configuration (e.g. adding currency: ['JPY'],
inside context
, currency will be JPY
).
If your multiple sites using different "currency" (e.g. one site uses "USD" and the other one uses "JPY"), then you cannot use static configuration. Dynamic configuration loads all base sites data, and get the default currency from each site (the value is: the defaultCurrency
of the first store in the site). So, you need make sure the site data is set correctly in backend.
Upvotes: 0