The SiteGenesis EMEA site uses a country list in the header of the main page to set the language and currency for the site. The country is listed in each language that has a locale enabled for the site. For example, if both fr_BE and nl_BE are enabled locales, then Belgium is listed in both French and Dutch.
Selecting a country from the list switches the site locale and changes the currency.
A customer can change the country at any point when using the site, but only on the home page of the site. This behavior is intentional, to prevent the customer from changing the currency in the checkout process. However, if the customer clicks to the home page and changes the country, the price is shown in the new currency in the basket. Changing the country is supported by default only for the main page, but the country selector can be enabled for any page on the site.
Select Administration > Global Preferences > Locales. Add the new locale.
Alternatively, in the demo_data_no_hires_images
folder that contains
the demo data, edit the preferences.xml
file
ActiveLocales
preference to include the new locale. Upload the
change to the demo data.
app_storefront_core
cartridge, edit the
countries.json
file to include the information for the new
locale.The country selector only appears on the home page. This location prevents consumers from price-shopping by currency and makes it unnecessary to check the locale for each request. You enable the country selector on other pages using the showCountrySelector flag to true.
The implementation of the country selector:
demo_data_no_hires_images
folder, review:
Folder | File | Description |
---|---|---|
/sites/SiteGenesisEMEA | preferences.xml | Sets the ActiveLocales preference, which sets the locales used by the storefront. Change this preference to add a locale after configuring it in Business Manager. However, if you remove a locale in Business Manager, you do not have to remove it from the ActiveLocales preference. |
app_storefront_core
cartridge, review the
following SiteGenesis files for the country selector
implementation:
Folder | File | Description |
---|---|---|
cartridge (at the top level) | countries.json | Maps countries to locales. If you are adding a locale, you must edit this file. |
scripts/util | Countries.ds | getCountries gets the countries to appear. |
scripts/util | URL.ds | Generates the current URL in the current locale. |
scripts/checkout | countryselector.isml | Template for the country selector. Requires the showCountrySelector flag to be set to true in the decorator template. |
content/home/pt_storefront | pt_storefront.isml | Sets This
flag adds the country selector to the page. |
app_storefront_core
cartridge, review the
following SiteGenesis files for multicurrency implementation:
Folder | File | Description |
---|---|---|
cartridge (at the top level) | countries.json | Maps countries to locales. If you are adding a locale, you must edit this file. |
scripts/util | Countries.ds | getCountries gets the countries to appear. |
scripts/util | URL.ds | Generates the current URL in the current locale. |
scripts/checkout | countryselector.isml | Template for the country selector. Requires the showCountrySelector flag to be set to true in the decorator template. |
content/home/pt_storefront | pt_storefront.isml | Sets This
flag adds the country selector to the page. |
app_storefront_core
cartridge, review the
following SiteGenesis files that implement multicurrency:
Cartridge | File |
---|---|
pipelines | Currency.xml |
scripts/checkout | CalculatePaymentTransactionTotals.ds |
scripts/checkout | CreateGiftCertificatePaymentInstrument.ds |
scripts/checkout | PreCalculateShipping.ds |
scripts/checkout/storepickup | InStoreShipments.ds |
scripts/giftcert | CreateGiftCertificatePaymentInstrument.ds |
scripts/product | ProductUtils.ds |
static/default/css | style.css |
templates/default/checkout/billing | billing.isml |
templates/default/checkout/shipping | shippingmethods.isml |
templates/default/checkout/shipping/multishipping | multishippingshipments.isml |
templates/default/checkout/shipping/storepickup | instoremessages.isml |
templates/default/components/header | headercustomerinfo.isml |
templates/default/components/header | multicurrency.isml |
templates/default/components/order | ordertotals.isml |
templates/default/product | productdetail.isml |
templates/default/product | producttile.isml |
templates/default/product/components | displayliproduct.isml |
templates/default/product/components | pricing.isml |
templates/default/product/components | standardprice.isml |
templates/resources | checkout.properties |
templates/resources | components.properties |
Currencies
Price Books
Business Manager: site > Products and Catalogs > Price Books. Price books: *-sales-prices and *-list-prices for each currency)
Each currency has two price books: list and sales. The lower price of list or sales appears as the effective price for a selected currency. If a price is missing from a price book for the selected currency, N/A appears for the price.
Option Prices
Price refinement Buckets
Price refinement buckets change when a different currency is selected. SiteGenesis provides price refinement buckets in USD and EUR. The price refinement bucket shows the currency symbol for the selected currency.
Promotions
SGJC contains the following promotions, which use a currency qualifier:
Certain promotion types are applicable to a selected currency. Non-currency based promotions (for example, 15% off) apply without adding a currency qualifier to the promotion.
Customer Groups
The currency associated with a country can trigger dynamic customer groups.
Gift Certificates
A gift certificate can be issued in a selected currency, and the currency can still be changed once it is added to the cart. When checkout begins, however, the customer can't change the currency or the gift certificate value.
When a customer checks a gift certificate balance, SGJC returns the balance with the currency symbol of the gift certificate when it was created. This action occurs regardless of the currency selected in the header.
Gift Certificates can only be redeemed for the currency in which they were issued. If the customer enters a valid gift certificate number using the wrong currency, an error message appears.
Shipping Methods
Business Manager: site > Merchant Tools > Ordering > Shipping Methods.
Only the defined and enabled shipping methods for a specific currency appear when a currency is selected. SiteGenesis provides different shipping methods for all supported currencies. SiteGenesis includes currency-specific shipping methods because a shipping method can have only one currency defined.
Wish List or Gift Registry
Wish list and gift registry items reflect the price of the selected currency. If the currency is not defined in the price book for an item, the price appears as N/A.
Taxes
Tax rules for multicurrency/multiple-country scenarios are based on the existing tax feature. SiteGenesis EMEA is configured as taxation = GROSS. Any EUR priced items have gross calculation, unlike standard SiteGenesis, which uses net calculation.
Payments
SGJC accepts payment in the selected currency. Although Salesforce B2C Commerce enhancements allow the qualification (or disqualification) of payment types based on the currency selected, this behavior is not implemented in SGJC.
Order History
Orders are saved in the currency in which they were placed, and appear with that currency (using the respective symbol) in the Business Manager Ordering module and in SiteGenesis (regardless of the currency selected). See Managing Orders.
SiteGenesis uses a custom attribute on a shipping method to support a 0 shipping cost for multicurrency. These files use this attribute:
Cartridge | Folder | File |
---|---|---|
SiteGenesis Storefront Core cartridge | templates/default/checkout/shipping/multishipping | multishippingshipments.isml |
templates/default/checkout/shipping/storepickup | instoremessages.isml | |
templates/default/checkout/shipping | shippingmethods.isml | |
templates/default/checkout/shipping/storepickup | InStoreShipments.ds |
This feature is supported by the shipment object's Boolean attribute storePickupEnabled. This attribute determines if the shipping method appears as an in-store shipping method. The cost is set in Business Manager, with the default values set to 0.00 for the 005 and EUR005 shipping methods.