InstallationSingle Server Deployment

Single Server Deployment

Configure Websites, Domains, Languages

  • Open the 'web.config' file of the Sana Commerce Starter Site project in any text editor;
  • Locate the 'sites' section in the 'sanaCommerce' configuration section: 

    <sites defaultsite="Demoshop" contentProvider="SanaSqlContentProvider" SendMailToReportAddress="false" ReportAddress="YourEmail">
    <site code="Demoshop" shopType="B2X">
            <providers>
                <provider name="CatalogProvider">NavisionStandardCatalogProvider</provider>
                <provider name="OrderProvider">NavisionStandardOrderProvider</provider>
                <provider name="ShopProvider">NavisionStandardShopProvider</provider>
                <provider name="CustomerProvider">NavisionStandardCustomerProvider</provider>
                <provider name="CommonProvider">NavisionStandardCommonProvider</provider>
            </providers>
        </site>
      
    </sites> 

    The 'sites' section describes all websites and their parameters:
    • The attribute 'defaultsite' points to the website that is used by default when no website is registered to the requested domain name;
    • The 'contentProvider' defines which content provider is used for all websites;
    • If 'SendMailToReportAddress' is set to 'true', all e-mail messages will be sent to the e-mail address that is specified in the 'ReportAddress' attribute. This field is used for testing purposes in the dev or beta environments: it makes sure that no e-mails are sent to real customer e-mail addresses. Please note that the 'ReportAddress' attribute is the required field even if the option is not used!
    • The attribute 'code' stores the name of the website and can be changed to an appropriate name for your project. It is linked with the similar code record stored in the 'Websites' table in the Sana Commerce SQL database;
    • The 'shopType' 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 website, change customer details, view the shop catalog anonymously and 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.
    • The 'providers' node defines the particular providers for each subsystem of the website. By default you can not change the provider name (attribute 'name'). This can only be done when new managers are added or when the existing framework functionality is overridden.
If you use NAV 2009 besides configuring the 'sites' section you should add the additional 'connectionType' tag for a provider in the 'modules' section in which providers for each subsystem are registered:
  • Locate the 'modules' configuration section;
  • Add the additional 'connectionType' tag with the value 'Nav2009' to providers which use the NAV 2009 WebService connection so it will look like the following way:
    <add name="Navision2009StandardCatalogProvider" connectionType="Nav2009" type="Sana.Commerce.Provider.Navision.Catalog.NavisionCatalogProvider, Sana.Commerce.Provider.Navision, Culture=neutral,PublicKeyToken=2b26dc7ce8e04e9f" description="CatalogProvider which retrieves catalogdata from Navision using NAV2009 WebService" serviceConnection="Nav2009StandardWebService"/>

Out of the box, one website is configured in the sites section and it is set as default site.

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 table 'Websites' in the Sana Commerce SQL database. When you have changed the website name in 'web.config', you also have to change this name in this 'Websites' table as well: 

 
The 'Websites' Table 

Now you have to specify on which domains the website 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 on which the website should run: 

 
The 'WebsiteDomains' Table 

This is done by creating a record in the 'WebsiteDomains' table: enter the website ID in the 'WebsiteId' column (it is taken from the 'Id' column in the 'Websites' table) and the domain name in the 'Domain' 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: you just enter the domain name\virtual directory.

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

Sana Commerce also supports multi-language per website. 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 in five languages: Dutch, English, German, Portuguese and French. 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 for a website, open the 'WebsiteLanguages' table and add extra records here:

 
The 'WebsiteLanguages' Table 

When the languages are in place in the 'WebsiteLanguages' table, you add the relations between the websites 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 website is done in the Sana Commerce backoffice. Please follow this link for more information.

InstallationSingle Server Deployment