Technical documentation - Market selector

For anonomous users it is possible to define markets and connect markets to price lists, warehouse (availability). A market will also have a suggested language to make it easier for the user.

Markets functionality is available in version 5.1 and later

Overview

When arriving at a site with market selector configured, anonomous users will get prompted to select user’s market. It may look like this:

Function has a few different options.

  • Show market selector at first visit

  • Prompt user by showing a bar at top. Suggested market will be based on browser’s language, but user may see all markets and select another if user wishes.

  • Present a full screen market selector.

The full screen market selector will show all markets. They will be grouped per region and sorted per name. The names will display in both english and in local language for that country.

Each market is also connected to a default language which will be set when user selects that market. User may change language at any point in time.

In case there are several markets for the same country, but with different language, the market will display with the language afterwards within ().

Selected market is stored in a cookie.

Defining markets

Available markets are defined in admin section where all markets are created. Each market may have a price list and a warehouse. If a market does not have a price list or a warehouse, that market will not display prices or availability. Each market is also connected to a default language which will be set when user selects that market.

If a market has several languages, then define the market two times but select different default language for each of the two. The combination of market and language has to be unique.

When creating a new market, select the country, the default languages and the price lists and warehouses. The Region is a free text field, but the drop down will display previously entered regions. The Region value is a key text so it may be translated using custom-texts.config.

In the case the automatically created name for the market is not wanted, it is possible to add a custom name. This custom name will then display instead of the automaticall created name. The custom name is a key text so it may be translated using custom-texts.config.

Directing user to a market using URL

It is possible to point a user to the site and select a market by adding the market to the URL. The market is referred using the code of the market (code column in settings page above).

This is how the url may look like.

http://domain.com/AssertWeb/en-GB/site/Catalogue/start/label?market=DE

Permissions

If a market is selected by using popup or by assigning a market to a user, the user will get a market permission. Also anonomous users visiting the site having selected a market will get this market permission. The market permission is the code on the market, eg. IT for Italy. If data is marked with permission IT, data will only be visible for that market.

This option is available in version 5.1.3 and later.

Price and Availability providers

Price and availability providers will populate the price lists and warehouses to select in the market setup screen.

Provider

Usage

Provider

Usage

AssertDbPriceProvider

The drop down with price lists will be populated with the price lists in the Server database. The CODE on the Market

AssertDbAvailabilityProvider

The drop down with warehouses lists will be populated with the warehouses in the Server database.

AssertRESTPriceProvider

The price list field will be a free text field. The value in the field will be included in the GetPrice REST call.

AssertRESTAvailabilityProvider

The wareouse field will be a free text field. The value in the field will be included in the GetAvailability REST call.

Configuration

Configuration is done in profile.config.

<MarketManager> <!-- Default market if market cannot be resolved by browser language or no other option exist --> <MarketManager default-market="EN,en-GB"/> </MarketManager> <MarketSetting> <!-- Enable market selection features --> <EnableMarketSelector>true</EnableMarketSelector> <!-- Will present market selector page at first visit to site by user. If false the market selector bar at the top will be presented instead. --> <EnableMarketViewFirstSiteVisit>true</EnableMarketViewFirstSiteVisit> <!-- Market selector will be shown as a modal popup instead of as a page --> <EnableMarketViewAsModal>true</EnableMarketViewAsModal> <!-- Hero image for the market selector screen --> <MarketViewHeaderImage>Download_header.jpg</MarketViewHeaderImage> </MarketSetting> <!-- Layout options for market (and language), see separate article --> <MainLayout> <!-- Will define where market selector is shown. --> <MarketSelector display="header" /> <LanguageSelector display="headertoolbar" /> </MainLayout>

For UI options for market selector see

For configuration of price and availability providers see separate articles.