Country, Language, Currency, and Price Books in Commerce Cloud Endless Aisle

The following are related:

In practice, when you switch from one country to another on the Welcome dialog or the login screen (if the Change Country link is enabled) in the app, the currency, languages supported, price books, and address form change to the ones associated with the new country.

For example, you can specify the following configurations:

  Germany France United States
Languages

English

French

German

English

French

German

English

French

German

Display Name Germany France United States
Currency Euro Euro Dollar
List price book German price book French price book United States price book
Sale price book German sale price book French sale price book United States sale price book
Address form addressForm_EU.js addressForm_EU.js addressForm_NA.js

For example, a customer who lives in Germany is shopping in an airport in France. In the store, the store associate switches from using France as the country to using Germany, which is where to ship the purchases. The app switches to the German price book and uses the address form appropriate for Germany.

The country determines the currency, price books, and address form. Multiple languages can be available for each country.

Salesforce B2C Commerce enables you to have:

Configuration How to change the configuration in the Endless Aisle app Where to find the configuration How to add a new configuration
Country You select the country when you start the Endless Aisle app for the first time or on the login screen if the Change Country Link is enabled To configure a country, look for the countryConfig section in the user.js.sample file. To add a new country, define a new country in the countryConfig section in user.js file.
Site The site that the Endless Aisle app runs against is based on the country you select the first time you start the app or on the login screen if the Change Country Link is enabled .

To configure which site the country points to, look for ocapi.site_url and storefront.site_url in the user.js.sample file for each country in the countryConfig section.

To add a new site, change the site_url in ocapi and storefront in each country in the countryConfig section of user.js.

Language You select the language when you start the Endless Aisle app for the first time or on the login screen if Change Country Link enabled. To configure a language for a country, look for languagesSupported in each country in the countryConfig section in the user.js.sample file and the definition of that language in the languageConfig section in countries.js Each country specified in the countryConfig section of app/assets/config/user.js can support multiple languages.

To add a new language:

  1. Ensure that the site supports the language (locale). For example, to enable Dutch, ensure that the locale "nl" is enabled for the site.
  2. Add a new strings.xml file in the app/i18n folder. For example, for Dutch, create a strings.xml file in a new app/i18n/nl folder.
  3. Copy the languageConfig section from app/assets/config/countries.js to app/assets/config/user.js.
  4. Add the new language in app/assets/config/user.js in the languageConfig section.
  5. Add the value of the new language in the languagesSupported for each country in which you want to support the new language.

For details about localization in B2C Commerce, see Localization.

Currency The currency format that the Endless Aisle app uses is based on the country you select the first time you start the app or the login screen if Change Country Link enabled. The currency value is based on the price book. To configure a currency format for a country, look for appCurrency in each country in the countryConfig section in the user.js.sample file and the definition of that currency in the currencyConfig section in countries.js. For Sales Reports in Business Manager, for each site, look for currencySymbol in the country configuration in Endless Aisle Catalog Preferences in Business Manager. Supported currencies are defined in the currencyConfig section of countries.js and are associated with the country using appCurrency in the countryConfig section of app/assets/config/user.js

To add a new currency:

  1. Ensure that the site supports the currency.
  2. Copy the currencyConfig section from app/assets/config/countries.js to app/assets/config/user.js
  3. Add the new currency to currencyConfig.
  4. Set the value for appCurrency to the new currency for each country in which you want to support the new currency.
  5. For reports in Business Manager to show the correct currency, set the currencySymbol in the country_configuration json (Endless Aisle Catalog Configuration).
Price Book The price books that the Endless Aisle app uses are based on the country you select the first time you start the app or on the login screen if Change Country Link enabled. To configure price books for a country, for each site, look for list_price_book and sale_price_book in the country configuration in Endless Aisle Catalog Preferences in Business Manager. To add a new price book :
  1. Ensure the price book specified is enabled for the site.
  2. Ensure the price book is listed for the product.prices.price_book_ids config of the resource/products/{id}/prices in the Shop Open Commerce API settings for each site.
  3. Add the list_price_book and sale_price_book for the country in which you want to support that price book in country configuration.
Address form The address form that the Endless Aisle app uses is based on the country you select the first time you start the app or on the login screen if Change Country Link enabled. To configure the address form for a country, ensure that the key and the value for the country in countryConfig in user.js.sample file and the key in address/addressConfig.js file match. For the address form definition, see the file associated with the country in addressConfig.js. There are default address forms that are included with the Endless Aisle app in the app/assets/config/address folder.

To add a new address form:

  1. Create a new address form in the app/assets/config/address folder.
  2. Add the new address form for each country in which you want to use the address form for in app/assets/config/address/addressConfig.js