Build
One storefront selling in several countries and currencies
- Vue
- Nuxt
- TypeScript
- Medusa
The problem
A shopper can open one country's store with a cart from another still saved in the browser. The page looks right, but prices, currency and shipping belong to the wrong market.
What I did
- Gave each country its own saved cart, so carts never cross markets
- Checked region, currency and shipping country before a cart reaches checkout
- Enforced the same market rules in the backend, not only the page
Keep the market attached to the request.
- Site contextLocale · content · currency
- Market APIResolve the selected market
- Scoped cartRegion + channel + currency
- CheckoutUse the matching cart