Languages, Countries & Currencies

It is one of the great paradoxes of the modern world, that while business and commerce is increasingly global, most customers are still local, and expect (to various degrees) to be served in their local language and currency.

And so, ironically, internationalization often means localization – conforming to local standards.

In Dynamicweb, languages and localization is handled separately for the content and Ecommerce – to learn about translations and localization of content, please see the Websites & Language Layers. The current article covers internationalization of Dynamicweb Ecommerce.

When working with Dynamicweb Ecommerce you have access to several types of tools for internationalization:

  • You can create Ecommerce languages, which allow you to localize context based fields e.g. product names, custom product fields, and so forth, and of course control which products should be available in which language contexts
  • You can create countries, and manage attributes related to them, e.g. country codes and default VAT and currency codes, and add regions to them if necessary.
  • You can create currencies related to the countries in which you do business, including exchange rates and currency-specific rounding methods
  • Finally, internationalization must also touch upon the wonderful world of sales taxes and VAT, locally and across borders – those topics are described in a dedicated article.

Read more below!

When you’ve created the languages, countries and currencies necessary for your setup, make sure you set a default country, language and currency on each website or language layer. Not doing so is one of the most common sources of WTFs in Dynamicweb.

Just like website content is localized by adding language layers to a website and then making changes to the language layer, your Ecommerce can be localized by adding a new Ecommerce language to your solution, and changing the localized content.

You can then select the language as the default language on the Ecommerce settings of a website. You should decide on your default language early on in your design process – changing the default language is not trivial, as it forces a localization of products and product groups to the new default languages, and may have other unintended consequences.

Adding a new Ecommerce language to your solution allows you to localize:

To add a new language to your solution:

  • Go to Settings > Ecommerce > Internationalization > Language
  • Click New Language in the toolbar to open the edit language view (Figure 2.1)
Figure 2.1 Adding a language to your solution

From here, you must:

  • Name the language, and select the matching country code
  • Provide a native name for the language – this name will be used when switching between language contexts
  • Check the default checkbox if this is your default Ecommerce language. Please note that changing the default language will force-localize all non-localized product to the new default language.

Once more than one Ecommerce language has been created, you can switch between language contexts in Dynamicweb Ecommerce by clicking the little flag icon in the ribbon bar of e.g. a product list (Figure 3.1)

Figure 3.1 Switching language context

For example, your default language is US English and you have a product group called Gift Cards with two products in it (Figure 3.2). You then switch the language context.

Figure 3.2 Switching language context

Once the language context has been switched to Danish, any products and product groups existing in your default language (Figure 3.3) will now appear greyed out – this is because they are not localized yet.

Figure 3.3 Switching language context

Content tied to only one language context

Some Ecommerce features are created in a particular language context – and exist only there. This is true for:

All of these are language-specific and cannot be localized, but must be created separately in each language context.

Localizing Ecommerce content is a matter of:

  • Switching the language context to the desired language
  • Selecting the content you want to localize
  • Localizing and saving the content

For instance, to localize products simply select them from a product list and click localize in the ribbon bar (Figure 5.1).

Figure 5.1 Localizing products

This will localize the selected products to the current language context – and the product group to which the products belong. You can also localize a product from the product details view by changing the language context and saving the product.

Similarly, to localize a product group:

  • Switch to the desired language context
  • Right-click the product group in the Ecommerce tree
  • Click Edit group and make any changes (e.g. changing the name) necessary
  • Save the group.

This localizes the product group, but not the products in it – they must be localized separately.

After localizing a part of your Ecommerce system, don’t forget to actually change the field content – names, prices, and so forth.

You can localize the following content:

To force-show unlocalized product catalog content, you can use the advanced configuration settings.

You can read about the settings in this article.

If you create a new product in the default language, it is unlocalized in all non-default languages.

If you create a new product in a non-default language, it will be unlocalized in all your other languages – including the default language.

If you localize it to the default language, you cannot delocalize it from the default language again – rather, you must deactivate it instead. Make sure you allow differentiated field values for the active-state across languages – read more below.

If you want to, you can force newly created products to be localized on creation to all of your languages. To do so:

  • Go to Settings > Ecommerce > Advanced configuration > General
  • Locate the Language section (Figure 6.1) and check the Activate products on all language versions on create checkbox.
Figure 6.1 Force-localizing new products

You can read more about the settings in Advanced configuration here.

When working with products across multiple languages, you may need to allow or disallow the localization of certain product fields.

For instance, you probably want to allow the name of a product to be different from one language to another, but the product number probably shouldn’t be different.

To control variation across languages,

  • Go to Settings > Ecommerce > Advanced configuration> Fields
  • Check the appropriate checkbox in the across all languages column (Figure 7.1).
Figure 7.1 Controlling variation across languages

You can read more about the Fields settings in this article.

For each country you do business with, you must create a corresponding country on your solution.

You can then select the country as the default country on the Ecommerce settings of a website.

Countries in Dynamicweb Ecommerce are used to:

  • Control which countries  and regions can be selected as billing and delivery countries
  • Anchor shipping methods and payment methods to a particular country – and preselecting default shipping and billing methods
  • Setting the system VAT rate

To add a new country to your solution:

  • Go to Settings > Ecommerce > Internationalization > Countries
  • Click New Country in the toolbar to open the country selector and add a country (Figure 8.1)
Figure 8.1 Adding a new country to your solution

A new country is created with the basic information already filled out, except the system VAT rate.

Under Default methods (Figure 8.2) you can select a default payment method and shipping method for the country.

They will be preselected in the shopping cart when the user checks out in the relevant country-context.

If none are available for selection, you need to create them and select them for the country (or All Countries). Switch between language contexts to access the methods created under a non-default language.

Figure 8.2 Selecting the default payment & shipping methods for a country - don't forget to switch to the appropriate language context

Under Region/States (Figure 8.3), you can add regions/states to the country.

This allows your users to select states and regions, in addition to the country, when specifying their delivery and billing addresses during checkout – and is also used for e.g. address validation services and the Avalara AvaTax provider when calculating taxes.

Figure 8.3 Creating regions or states for a country

Currencies in Dynamicweb allow you to create and manage currencies related to the countries or economic zones in which you do business.

You can then select the currency as the default currency on the Ecommerce settings of a website.

To create a new currency:

  • Go to Settings > Ecommerce > Internationalization > Currency
  • Click New Currency in the toolbar to open the Edit currency view (Figure 9.1)
Figure 9.1 Adding a currency to your solution

From edit currency view, you can:

  • Name the currency (the name can be localized to fit each of your languages)
  • Select a region in the regional info dropdown – if a region is selected here, the Settings section will be auto-filled by the system and will not be editable.
  • Set an exchange rate for the currency (in relation to your default currency)
  • Check the Default checkbox if you want this currency to be your default, or base, currency.
  • Select a rounding method for prices in the selected currency – if none are available, you must create them. Read more below.

If you selected a region from the regional settings dropdown, you have access to the regional settings. With these you can customize how positive and negative amounts are rendered – or use the default pattern.

If you don’t use the region dropdown you have access to the Settings fields, where you can select a currency code, currency symbol, currency format and a payment code manually.

On Exchange rates

To get correct exchange rates, you must define non-default currencies in relation to the default currency in the following manner:

  • USD: 100
  • EUR: 125
  • DKK: 665

In other words, the rate should be the number of default currency units required to get the default currency amount (100) in the non-default currency.

Prices in Dynamicweb are subject to changes – from changing exchange rates, taxes, VAT rates and so forth.

To combat weird prices, and to conform to currency-specific pricing practices (such as .99-prices), you can set up rounding methods and apply them to a currency.

To create a rounding method:

  • Go to Settings > Ecommerce > Advanced configuration > Rounding
  • Click New rounding in the toolbar to open the rounding method definitions (Figure 10.1)
Figure 10.1 Creating a rounding method

From here, you must:

  • Name the rounding method – it’s a good idea to make the name descriptive of the method, since you will be selecting it based on the name only
  • Select a methodup, down or nearest.
  • Select a factor to round by and optionally an addition to add or subtract from the rounded price – for both integers and decimals.
  • Specify the number of decimal places to include

Once a method has been saved for the first time, you will have access to the test-area. This is very useful!

To use the test area (and remove some confusion about the rounding rules):

  • Enter an amount in the Amount-field
  • Click the play-button to see how the rounding method behaves

Once created, you can apply the rounding method to a currency by going to Settings > Ecommerce > Internationalization > Currency, editing the currency, and selecting the rounding method (Figure 10.2).

Figure 10.2 Applying a rounding method to a currency

You cannot apply two rounding methods to a single currency - if this happens for any reason, e.g. through custom code, neither rule will be applied.

Dynamicweb supports a number of query string operations for manipulating the internationalization settings:

Parameter Effect
LanguageID=LANG1 Switches the language context to LANG1
CurrencyCode=EUR Switches the currency context to EUR
CountryCode=US Switches the country context to US

 

Database

These are the database tables related to internationaliation in Dynamicweb:

EcomCountries

Contains countries defined in Settings -> Ecom -> Internationalization -> Countries.

Field name Data type Length
CountryId int 4
CountryCode2 nchar 2
CountryCode3 nvarchar 3
CountryCurrencyCode nvarchar 3
CountryNumber nvarchar 4
CountryVAT float 8
CountryCultureInfo nvarchar 10
CountryRegionCode nvarchar 3

EcomCountryText

Defines what languages (CountryTextLanguageID) a country is translated for (CountryTextCode2).

Field name Data type Length
CountryTextCode2 nchar 2
CountryTextLanguageId nvarchar 50
CountryTextName nvarchar 255
CountryTextRegionCode nvarchar 3
CountryTextAutoId int 4

EcomCurrencies

Contains the currencies defined -> Settings -> Ecom -> Internationalization -> Currencies.

Field name Data type Length
CurrencyCode nvarchar 3
CurrencyLanguageId nvarchar 50
CurrencySymbol nvarchar 5
CurrencyName nvarchar 50
CurrencyRate float 8
CurrencyIsDefault bit 1
CurrencyCultureInfo nvarchar 50
CurrencyPayGatewayCode smallint 2
CurrencyRoundingId nvarchar 50
CurrencySymbolPlace int 4
CurrencyAutoId int 4
CurrencyPositivePattern int 4
CurrencyNegativePattern int 4

EcomGlobalIso

System lookup table for internationalization ISO data.

Field name Data type Length
IsoId int 4
IsoCode2 nchar 2
IsoCode3 nvarchar 3
IsoCountryNameDK nvarchar 255
IsoCountryNameUK nvarchar 255
IsoCurrencyCode int 4
IsoCurrencySymbol nvarchar 255
IsoVat float 8
IsoCultureInfo nvarchar 50
IsoDisabled bit 1

EcomLanguages

Contains language setup from Settings -> Ecom -> Internationalization -> Languages.

Field name Data type Length
LanguageId nvarchar 50
LanguageCode2 nvarchar 50
LanguageName nvarchar 255
LanguageNativeName nvarchar 255
LanguageIsDefault bit 1
LanguageAutoId int 4

EcomMethodCountryRelation

Keeps track of for which countries (MethodCountryRelCountryID) a given translation (MethodCountryRelLanguageID) of a payment- or shipping method (MethodCountryRelMethodID) is available.

Field name Data type Length
MethodCountryRelCode2 nvarchar 50
MethodCountryRelMethodType nvarchar 50
MethodCountryRelCountryId nvarchar 50
MethodCountryRelMethodId nvarchar 50
MethodCountryRelLanguageId nvarchar 50
MethodCountryRelIsDefault bit 1
MethodCountryRelRegionCode nvarchar 3
MethodCountryRelAutoId int 4

EcomRoundings

Contains setup data for rounding methods as defined in Settings -> Ecom -> Advanced configuration -> Rounding.

Field name Data type Length
RoundingId nvarchar 50
RoundingName nvarchar 255
RoundingModIntegerPart int 4
RoundingModDecimalPart int 4
RoundingModIntegerCorrection int 4
RoundingModDecimalCorrection int 4
RoundingMethod int 4
RoundingDecimals int 4
RoundingAutoId int 4

EcomCustomersSettings

Links a user (AccessUserId) with preferred currency, payment method and shipping method (CurrencyCode, PaymentMethodId, ShippingMethodId).

Field name Data type Length
SettingId int 4
AccessUserId int 4
PaymentMethodId nvarchar 50
ShippingMethodId nvarchar 50
CurrencyCode nvarchar 3