ConfigurationMultiple Domains and Websites

Multiple Domains and Websites

Sana Commerce 8.2
Your provider

Configure Multiple Websites

Out of the box, one webshop is configured in Sana Commerce, but you can easily add additional webshops. In order to do this, you should take the following steps:

Step 1: Add a new webshop in the Sana Commerce SQL database:

  • Add a new webshop to the 'Websites' table: create a new record, enter the name and the default language for it.
  • Create a new record in the 'Settings' table. After this you have two choices of filling the 'Fields' column: by creating a SQL scipt which will automatically fill it or by configuring the webshop settings using backoffice. If you choose the second option please read Step 5.
  • Specify on which domains the webshop will run: open the 'WebsiteDomains' table, create a record and enter the ID of the additional webshop and a domain name. If you want to add an additional domain name to your webshop please read the previous chapter.
  • Specify the languages that should be available in the new webshop: open the 'WebsiteLanguages' table and create records for each language by entering the 'WebsiteId' of your webshop and the 'LanguageId' in the appropriate fields.

Step 2: Configure your webshop in the 'web.config' files of the backoffice and Starter Site:

  • Add the new 'site' node to the 'sites' section in the 'sanaCommerce' configuration section (for a description of the 'site' node properties, please read this chapter).
  • Set the 'defaultsite' attribute of the <sites> node to the default site. The 'defaultsite' attribute points to the webshop that is used by default when the backoffice is opened for the first time.
  • Select providers from the <modules> section to work with your webshop. All providers are divided into five main subsystems; the description of each provider is stored in the 'description' attribute.

Step 3: Add the domain name of your webshop in IIS (please check the previous chapter for more details).

Step 4: Request a new license file for the new domain. Please read about requesting a license file here.

Step 5: Open the Sana Commerce backoffice and check if the new webshop appears in the list. For more information about configuring a webshop in the backoffice, please read this chapter.

The availability of each setting on the 'Settings -> General' page is configured in the 'WebsiteSettings' table in the Sana Commerce SQL database. If you want to show or hide a specific setting, open the table and set the 'configurable' attribute to 'false' or 'true', depending on whether or not the specified setting should be shown for the webshop in the backoffice. 

Step 6: In the Sana Commerce backoffice create content and navigation for the new webshop. You can also reuse the content of the existing webshop by linking it to the new webshop using channels. More detailed information about webshop content and navigation can be found in the 'Content' section.

Step 7: To be able to process the orders in the newly added webshop the system payment methods and related countries must be configured in the database (On Account and Zero):

  • Open the Sana Commerce SQL database.
  • Locate the 'PaymentMethods' table and open it. Use the 'PaymentMethods' table to configure 'On Account' and 'Zero' system payment methods:


    System Payment Methods

This table provides the description of the required fields:

Field Description 
WebsiteId ID of the newly added webshop.
Name Name of the system payment method:
  • On account
  • Zero
PaymentModuleId Payment module to which a payment method is mapped in the 'web.config' file of the Sana Commerce frontend:
  • OnAccount
  • Zero
Active A setting which allows to enable or disable system payment method.

Available values:

  • True
  • False
IsSystemPaymentMethod A setting which indicates whether a payment method is system.

The value must be set to 'True'.

IsExternalPaymentMethod A setting which indicates whether a payment method is external.

The value must be set to 'False'.

Step 8: Open the 'PaymentMethodCountries' table and specify which payment methods should be available for which countries.

If the 'CountryId' field for a payment method is 'NULL' then this payment method will be available for all countries.
If there is no record for a payment method in the 'PaymentMethodCountries' table then this payment method will not be available.

For more information about payments see additional resources:

Step 9: To be able to create shipping methods in the Sana Commerce backoffice for the newly added webshop, shipping providers should be added in the database:

  • Open the Sana Commerce SQL database.
  • Locate the 'ShippingProviderSettings' table and open it. Use the 'ShippingProviderSettings' table to add shipping providers:


    Shipping Providers

This table provides the description of the required fields:

Field Description
ProviderType Type of the shipping provider.
Name Name of the shipping provider.
WebsiteId ID of the newly added webshop.

This table provides the values of the available shipping provider types ('ProviderType' field) and related names ('Name' field):

ProviderType Name
fixed Shipping rate by country
fixed-onweight Shipping rate by country and total order weight
fixed-ranges Shipping rate by country and order total
FedEx FedEx shipping rate

'FedEx' shipping provider can be added only if FedEx add-on is already installed.
'Shipping rate by country and order total' is used only for SQL Provider.

When the shipping providers are added to the 'ShippingProviderSettings' table of the Sana Commerce SQL database you can create shipping methods in the Sana Commerce backoffice.

For the detailed information about configuration of shipping providers and methods in the Sana Commerce backoffice, see 'Shipping Providers'.

ConfigurationMultiple Domains and Websites