Handle Currency Changes
Commerce carts don’t automatically support currency changes. If your store supports multiple currencies, we recommend that you deactivate the currency picker when a customer places an item in the cart. However, you can create a custom process to handle currency changes when items are in the cart. First create a secondary cart to move existing items into, and then set the desired currency for the new cart.
Make sure that products and price books are set up correctly in each currency that your store supports.
-
Create a new cart in the new currency. Use Commerce Webstore Carts.
-
Add items from the previous cart to the new cart. Use Commerce Webstore Cart Items or Commerce Webstore Cart Items, Batch.
-
Delete the previous cart. Use the DELETE method on Commerce Webstore Cart.
-
Set the new cart as the primary cart. Use Commerce Webstore Cart, Make Primary.
To allow buyers to shop in a non-default currency, you can specify a currency when creating a new cart. This creates the cart in the user's preferred currency without changing the account's default currency.
- When creating a cart using the Commerce Webstore Carts API, set the
currencyIsoCode
parameter to specify a currency different from the account’s default. This overrides the account’s default currency for that specific cart only. - The account’s default currency remains unchanged, preventing conflicts when multiple users from the same account shop in different currencies.
For example, your account Account1 defaults to USD
, but you want to shop in EUR
. Include "currencyIsoCode": "EUR"
when creating the cart. The system creates your cart in EUR
, while other users in Account1 continue shopping in USD
.