Currency
 American Dollar   British Pound 

18. Multisite feature


ViArt Shop ManualViArt Shop Manual
18. Multisite feature
Prev Index Next

The built-in multisite feature is the hugest and long wait functionality which will help you to build any number of sites sharing the same database. Multi-Site treats multiple sites as truly independent sites and enables you to utilise numerous functionalities completely separate from the parent site.

You will definitely want to have a deep inside on the functionality. There are two ways to configure your multi-site functionality, namely:

  • Create a separate folder for each shop and copy all the files from the parent shop
  • Configure the var_definition file to support multi-site feature from one location

Create a separate folder for each shop and copy all the files from the parent shop

Let's start from the steps necessary to activate a Multi-Site feature as per first method (assume we need to add one sub site). Please, follow the steps below:

  1. Create a separate folder with a different name on your server, make a copy of your current shop and paste it in the created folder. Therefore, you should have two shops with different names, like: shop 1 and shop 2.

  2. Copy var_definition.php file from your current shop and paste it to the 'includes' folder of your subsite to save the data of your DB. Please, do not forget to do it for other shops (if you have more than two shops).

  3. Further, open the Admin console of your parent shop via browser and go to Administration > System > Privilege Groups > Administrator > Edit Permissions. Check off appropriate options from Multisite section. This step is extremely important, otherwise you won’t be able to start sites configurations.

  4. When doing this, you will see the Sites Section in the System menu at once. Click the Site Menu and add the second site by pressing the New Site link. Give the name to your sub-site and select whether you want to duplicate the Page and Global settings of your first site or not.

  5. Further important step is to set the correct site URL for each of the site. To do this, please go to Administration > System > Global Settings, select Current Site from the drop down box in the upper right corner and set the URL for this site like: http://www.yoursite.com/shop1. Then select the second site and specify the URL, like: http://www.yoursite.com/shop2. If you are using SSL for your shop, then you should change the SSL site URLs as well, like: https://www.yoursite.com/shop1 and https://www.yoursite.com/shop2.
  6. Please, also note that you should decide at once whether to use MD5 Password encryption or not, because the method you select for one site will be automatically applied to all your sites.

  7. The next step is to add your site IDs to the var_definition file. This is a very important step. For this firstly open the var_definition file for the parent shop and insert the below string under the line: $session_prefix = "";
    $site_id = 1;
    where 1 is a unique ID number of your parent site, for example. Please, ensure that you use correct IDs for all your subsites. You will find the correct site ID in the browser's bar when selecting this or that site. Save the file and add the same string in the var_definition file for your subsite.

    In addition, it is highly recommended to specify the correct names of your folders (where your subsite(s) are located) for session prefixes. For instance, if your subsite is located in the folder 'testshop1', then please specify: $session_prefix = "testshop1";

Configure the var_definition file to support multi-site feature from one location

There is another possible way to support Multi-site feature if all your subsites are located in one place (for example, if your server can be configured to support virtual hosts). However, please note that appropriate changes are to be done on your server first. When this is done you need to configure your var_defintion file to use only one copy of files for all your subsites. Please, open your var_defintion file and insert the below code (instead of adding the site ID - as per the first method):

$http_host = $_SERVER["HTTP_HOST"];

if (preg_match("/^(www\.)?example\.com$/i", $http_host) {

$site_id = 2;

}elseif (preg_match("/^(www\.)?another\.com$/i", $http_host) { {

$site_id = 3;

} else {

$site_id = 1;

}

where www.example.com - is your second sub-site, www.another.com is your third subsite and site_id=1 is your parent site. This example is valid if you want to use Multi-site for three sites. In case you will have more sites you are to add one more string of the code per each subsequent subsite, namely:

} elseif (preg_match("/^(www\.)?another2\.com$/i", $http_host) {

$site_id = 4;

Note: All the Admin settings stated above are to be done for the second method as well.

Set different categories and products for the sites

  1. Please ensure that you set the appropriate permissions for the category.

  2. Go to Administration > Products and Categories. Select a Category and click the Edit link. You will see the Sites tab there. In case you want to use this category for all your sites, tick off the 'Use this category for all sites'. If you are going to use the categories for particular sites, it is recommended to leave this option unticked and select the sites where you want this category to be displayed. Besides, there are some additional options to display products within this category, within subcategories. Please, see the attached image how it should look:


  3. You can also select to show a particular product on different sites. This is done on the Product Edit page (Sites Tab).

Set sites for different users groups

If you need to assign different customer groups to different sites, go to Administration > Site Users > Profile Settings >, select a particular type and click the Edit Type > Sites tab. Select on what sites to display this customer group from the list of available sites or tick off the 'Use this user type for all sites'. Then this customer type will be displayed on all your sites.


Set different prices for various users groups

Multi-site functionality enables you to use different prices on different shops. To set the prices, go to Administration > Products&Categories, select a particular product and click the Prices link. Specify minimum and maximum amounts and the individual pricing. Further, select the user group and the site you want to show the prices on. Please, use the below image as an example.


CMS settings for multiple sites

Set a unique template for each site

With multi-site feature you can manage multiple sites with unique layouts within one web interface. To select a particular layout for one site, please go to Administration > CMS > Layout > Select a layout you want to set for the site and press the Global button. You will see the 'Sites' tab there. Go there and select what site will have this particular layout by unticking the default option 'Use this layout for all sites'. When this is done, please click the 'Update' button. Follow the same procedure for other sites.

Create different header menu items for different sites

Multisite enables you to add different menu items to each site. To do this, please go to Administration > CMS > Layouts > Site navigation and add the links you want to be displayed for this particular site. When this is done, select another layout for your sub-site and change or add other menu items. For more information on how to add menu items, please click here see section 3.4.3.

You can attune all other ViArt Shop features for different sites, like Filters, Custom pages, Custom fURls, Manuals, Forum, Ads. Therefore, you can have a plenty of opportunities to play with.

Prev Index Next