InstallationDeveloper Workstation Installation

Developer Workstation Installation

Configure Websites, Domains, Languages

Websites Configuration

Out of the box, one website is configured in the 'sites' section of the 'web.config' files and it is set as a default site. To configure the websites:

  • Open the 'web.config' file of the Sana Commerce Starter Site project in VS2008;
  • Locate the 'sites' section in the 'sanaCommerce' configuration section and set the necessary values:
<sites defaultsite="Demoshop" contentProvider="SanaSqlContentProvider" SendMailToReportAddress="true" ReportAddress="YourEmail">
   <site code="Demoshop" shopType="B2X">
            <provider name="CatalogProvider">NavisionStandardCatalogProvider</provider>
            <provider name="OrderProvider">NavisionStandardOrderProvider</provider>
            <provider name="ShopProvider">SanaSqlShopProvider</provider>
            <provider name="CustomerProvider">NavisionStandardCustomerProvider</provider>
            <provider name="CommonProvider">NavisionStandardCommonProvider</provider>

The table below provides the description of all website parameters:

Parameter Description
defaultsite Points to the webshop that is used by default when no webshop is registered on the requested domain name.
contentProvider Defines which content provider is used for all webshops.
SendMailToReportAddress If 'SendMailToReportAddress' is set to 'true', all e-mail messages will be sent to the e-mail address that has been specified in the 'ReportAddress' attribute. This field is used for testing purposes in the dev or beta environments: it makes sure no e-mail is sent to real customer e-mail addresses. Please note that the 'ReportAddress' attribute is the required field even if the option is not used!
code Stores the name of the webshop and can be changed to an appropriate name for your project. This attribute is linked to the similar code record stored in the 'Websites' table in the Sana Commerce SQL database.

Defines the type of the business scenario that is supported by the webshop:

  • B2B - a general 'business to business' scenario. When the webshop is set as B2B, a customer cannot register on the webshop, change customer details, view the shop catalog anonymously or use different payment methods;
  • B2X - a 'business to business' scenario combined with a 'business to customer' scenario. When the webshop is set as B2X, a customer is free from all the restrictions of the B2B scenario;
  • B2C - A general 'business to customer' scenario. When the webshop is set as B2C, a customer is free from all the restrictions of the B2B scenario.
providers Defines the particular providers for each subsystem of the webshop. By default you can not change the provider name (attribute 'name'). This can be only when the new managers are added or when the existing framework functionality is overridden.

An important value in the 'sites' configuration section is the value in the code attribute of the site node. This value, in this case 'Demoshop', refers to a record in the table 'Websites' in the Sana Commerce SQL database. When you have changed the name of the webshop in the 'web.config' file, you also have to change this name in the 'Websites' table: 

The 'Websites' Table 

The presentation of the address information on the Starter Site differs for the SQL Provider and NAV Connector webshops. The address information in the webshop is specified during the registration process and also available on the 'Your details', 'Prospect details' pages and on the second step of the checkout process, when a customer needs to specify the address the order should be delivered to.

In case of using Sana Commerce - NAV Connecter with a B2X scenario you need to change the presentation of the address information for the correct data mapping. It can be performed by changing the default value of the 'DetailedAddress' parameter specified in the 'Settings' table of the Sana Commerce SQL database.
Default value: True

To change the default value of the 'DetailedAddress' parameter a SQL script should be executed on the Sana Commerce database:

  • Before executing the script specify the website ID in the script:
    UPDATE Settings
          SET Fields = REPLACE(CONVERT(nvarchar(MAX), Fields),
          '<field name="DetailedAddress" type="System.Boolean, mscorlib"><boolean>true</boolean></field>',
          '<field name="DetailedAddress" type="System.Boolean, mscorlib"><boolean>false</boolean></field>')
          WHERE Id = 'YourWebSiteId'
  • When the website ID is specified, execute the SQL script on the Sana Commerce database.

The SQL script will change the default value of the 'DetailedAddress' parameter to 'False' and the presentation of the address information on the Starter Site will correspond to the address fields used in NAV.

Domains Configuration

You can now specify on which domains the webshop will be running. This can be done in the 'WebsiteDomains' table. Open this table in the 'SQL Management Studio' and add records for all domains the webshop should run on: 

The 'WebsiteDomains' Table 

This is done by creating a record in the 'WebsiteDomains' table: enter the webshop ID in the 'WebsiteId' column (it is taken from the 'Id' column in the 'Websites' table) and the domain name in the 'Domain' column. To configure the default webshop domain set the 'True' value in the 'IsDefault' column.

There is no need to add port numbers here (for example, for the web servers which are started by Visual Studio), since Sana Commerce only checks the domain name and the virtual directory and not the port number. As stated earlier it is also possible to run a Sana Commerce web application on a virtual directory. To do this, just enter the domain name\virtual directory.

Add your IP address and the domain name in the 'hosts' file. This file is stored in the 'C:\WINDOWS\system32\drivers\etc' directory and contains the mappings of IP addresses to host names. The IP address should be entered in the first column followed by the corresponding host name.

In order to add an additional web domain or a website, please read this section.

Languages Configuration

Sana Commerce also supports multi-language per webshop. This can be configured in the 'WebsiteLanguages' table, which is a link table between the table 'Websites' and the table 'Languages'. Out of the box, Sana Commerce comes with two languages: Dutch and English. These languages are specified in the 'Languages' table:

The 'Languages' Table

 ID The Windows Code Page Id of the Language
DisplayName: The name of the language that will be shown in the 'Language' dropdown in the frontend.
IsDefault: A Boolean value indicating if the language is used as the default language in the backoffice.

In order to add additional languages to a webshop, open the 'WebsiteLanguages' table and add extra records here:

The 'WebsiteLanguages' Table 

When the languages are in place, on up the 'WebsiteLanguages' table you can add the relations between the webshops and the languages. To specify the default language for the frontend, open the 'Websites' table again and set the 'LanguageId' of the default language in the 'defaultLanguageId' field.
General configuration of a webshop is done in the Sana Commerce backoffice. Please follow this link for more information.
InstallationDeveloper Workstation Installation