Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Implement Multi-Currency Sites

Learning Objectives

After completing this unit, you’ll be able to:

  • Explain why you would want to implement a multi-currency site.
  • Explain how Salesforce B2C Commerce uses session currency for multi-currency sites.
  • List the reports and analytics that support the multi-currency site feature.
  • Explain how to show prices in multiple currencies on the product details page.

Why Multi-Currency Sites?

The Salesforce B2C Commerce multi-currency site feature takes a leap beyond site localization. It’s a way to sell products in multiple countries or regions from a single site using up to 150 currencies. It’s like flipping a switch. Shoppers can select a currency, and then browse products and checkout using that currency.

A multi-currency site implementation gives shoppers a switch so they can flip from one currency to another.

Brandon Wilson, Cloud Kicks merchandiser, considers why he might use this feature.

  • Product prices, shipping methods, shipping costs, payment methods, and promotions vary only by currency for multiple storefronts.
  • Storefronts on his site are the same for these elements.
    • Logic and design
    • Catalog and content
    • Search and merchandising rules
    • Customers
    • Inventory
    • Third-party integrations
    • Order management
Note

Support for multi-currency sites is limited to certain areas of B2C Commerce.

Session Currency

B2C Commerce uses the browser’s session currency to support this feature. It’s automatically supported in Business Manager and various reports and analytics tools. When a shopper first accesses the storefront, their session currency is initialized with the site’s default currency. B2C Commerce uses this currency as the session currency until the shopper selects a different preferred currency.

While B2C Commerce automatically supports this feature when activated, a developer must add custom business logic to the storefront application to provide this capability.

B2C Commerce remembers and restores a shopper’s session currency when they return to the storefront. Their session currency can become invalid, such as if the administrator removes an allowed currency. If the session currency becomes invalid, B2C Commerce simply resets it to the default site currency the next time the shopper accesses the storefront.

The session currency must be an allowed currency that’s configured for the site. The shopper can’t check out or create an order with an invalid currency.

Reports and Analytics

These features report revenue amounts for sites that use this feature.

Report Description

A/B Testing

A/B test statistics reflect the converted monetary value on an order placed during an A/B test.

Active Data

B2C Commerce changes customer active data for the customer placing the order and product active data for the ordered products to reflect the converted money values.

Reports & Dashboards

You can change the realm currency setting so that aggregated realm data for all sites shows in the selected currency.

These features use storefront purchase data to provide revenue metrics that Brandon can view or use for other features such as search sorting or customer segmentation. When B2C Commerce records a revenue event, all monetary values are converted to the site’s default currency. The conversion uses the exchange rate that’s applicable for that day.

For example, a site's default currency is US Dollar (USD), but the site supports both USD and Euro (EUR). When a customer places an order using Euro for payment, the order values are converted from EUR to USD using that day’s exchange rate.

B2C Commerce does not provide separate reporting for each currency. The exchange rate service is internal to B2C Commerce and not viewable in Business Manager or through the B2C Commerce API. Because the values are based on an exchange rate service that’s regularly updated, the metrics provided by these subsystems are appropriate for a multi-currency scenario.

Implement Multi-Currency

Brandon can perform some tasks to implement this feature, but he needs to get admin Linda Rosenberg and developer Vijay Lahiri involved. Here are the steps they need to take.

Step Task Description Role

1

Configure allowed currencies for the site.

When a site is created, specify a single default currency. After the site is created, add allowed currencies.

Admin

2

Create price books for each currency.

B2C Commerce looks up prices using the session currency. Each price book is specific to a single currency. To support three currencies, create at least three price books, one for each currency.

Merchandiser

3

Configure promotions to account for currency.

When you configure a promotion, you can optionally specify a currency. If the promotion applies to all currencies, for example, 10% off, select a specific currency, such as EURO or All.

You can create a promotion for a specific currency. However, the promotion applies only when the customer selects the specified currency as the session currency.

Merchandiser

4

Configure payment methods to specify a currency.

When you configure a payment method, you can optionally specify one or more allowed currencies. If you don't specify a currency, when you create a payment method, all allowed currencies are accepted by default.

You can restrict a payment method to one or more currencies. However, the payment method only applies when the shopper selects one of the specified currencies as the session currency.

You can specify minimum and maximum payment ranges for each allowed currency.

Merchandiser

5

Configure shipping methods to specify a currency.

When you configure a shipping method, you can optionally specify an allowed currency. If you don't specify a currency, B2C Commerce uses the default currency for the site.

The shipping method applies only when the shopper selects the specified currency as the session currency.

Merchandiser

6

Customize the storefront to enable the shopper to select a preferred currency.

The storefront must allow shoppers to select a preferred currency from a list of allowed currencies.

Use the dw.system.Session B2C Commerce Script API object to set the session currency.

Developer

7

Modify the import process to account for changes related to multi-currency sites.

Review the documentation.

Developer

Show Prices in Multiple Currencies

There’s a slight twist with B2C Commerce multi-currency feature offerings that Brandon finds helpful. He learned that he can use the APIs to show product prices in a different currency, along with the actual sales price in the site currency on the product detail page. This feature is for the product details page only, but it suits one of his site requirements. 

Bear in mind that this feature is not part of the multi-currency checkout feature highlighted in this unit. And features such as search result sorting, search refinements, price ranges, and other price-related features are limited to the site currency only.

This feature involves customizing code, so he asks Vijay to help. Vijay uses these B2C Commerce API methods in the storefront application.

  • ProductPriceModel.getPriceBookPrice(String priceBookID)
  • ProductPriceModel.getPriceBookPrice(String priceBookID, Quantity quantity)

It’s a simple feature. When the price book currency is different from the site currency, these methods return a product price.

Let’s Wrap It Up

In this module, you learned a few ways you can implement multi-currency with B2C Commerce. Now take the final quiz and earn an awesome badge.

Resources

在 Salesforce 帮助中分享 Trailhead 反馈

我们很想听听您使用 Trailhead 的经验——您现在可以随时从 Salesforce 帮助网站访问新的反馈表单。

了解更多 继续分享反馈