Many eCommerce stores begin as a single store selling particular products or services. Over a period time, when the business expands, they may have more than one product line. They may also expand to other lucrative geographies.

In such cases, there arises a need for multiple websites for the company. Instead of having multiple websites, vendors can have multiple stores with same/different domains using the multi-store feature of Magento. Magento allows the merchant to create multiple stores and store views.

Below is the global website store methodology as defined in “Learning Magento 2 Administration” by Bret Williams & Cyndi Williams.

Global – Global refers to any configuration or setting that affects the entire Magento installation. Some settings such as security, product SKUs, and logging apply to all stores.

Website – Website is akin to a business entity as many of the settings made at this level pertain to payment gateways, shipping, taxes, and so on.

Store – Store is the level where you assign a particular product catalog. It is at this level that we begin differentiating stores by the products offered.

Store View – Store Views are mostly used to handle different languages on your website. You will typically have one Store View per language.

Magento 2 B2B

STEP 1: To create a new website

Login to Magento Backend

  1. Click Store > Settings > All Stores.
  2. On the Stores page, click Create Website.
    • Name: Enter your website name.
    • Code: Enter a unique code for the website.
    • Sort Order: It is an optional field and is set to maximum value ‘0’ by default.
  3. Then Save Web Site.

magento2 B2B

STEP 2: To create a new store

  1. Click Store > Settings > All Stores.
  2. On the Stores page, click Create Store.
    1. Choose the Website of your choice.
    2. Name the Store.
    3. Choose the Root Category that needs to be displayed within that store.

      To add a new root category follow the steps below.

      1. Go to Product > Categories.
      2. Click Add Root Category in the left column of the page.
      3. Enter the Category Name, enable the category and Save the changes.
  3. Click Save Store.

Magento2 B2B

STEP 3: To create a new store view

  1. Click Store > Settings > All Stores.
  2. On the Stores page, click Create Store View.
    1. Choose the Store of your choice.
    2. Name the Store View.
    3. Set the status Enabled.
  3. Status is an optional field and is set to maximum value ‘0’ by default.
  4. Click Save Store View.

magento2 B2B

STEP 4: To check for mode and access permissions

Note: This step is for the beginners in Magento 2. If you have not changed to any mode previously then you are set to be in the default mode. To configure multi store view, you have to change to the developer mode by following these steps.

  1. Give permissions to the below directories.
  2. chmod -R a+wX var

    chmod -R a+wX app/etc

    chmod -R a+wX pub

  3. The command to change the mode is,

bin/magento deploy:mode:set developer

Another way to enable developer mode is,

      1. Goto app/etc/ and open env.php
      2. and change current application mode by MAGE_MODE’ => ‘default’ to MAGE_MODE’ => ‘developer’.

STEP 5: To create a new website

  1. Copy the index.php file and .htaccess file from the Magento root directory to the directory created for the new website within the magento root directory.
  2. Replace the code of index.php into the following code snippet.
    • Before:
    • After:

  3. In the Admin, click Stores > Settings > Configuration > General > Web.
  4. From the Store View listed on the top of the page, choose a website, other than the default website.
  5. In the right panel, expand Base URLs. Unselect Use Default. Consider the following as examples to fill the fields.
  6. Base URL : http://localhost/magento/newstore/

    Base Link URL : http://localhost/magento/newstore/

    Base URL for Static View Files(default value) : http://localhost/magento/pub/static/

    Base URL for User Media Files(default value) :   http://localhost/magento/pub/media/

    Fill the same in the fields under Base URLs (Secure) if needed for ‘https’ access.

    magento2 B2B

  7. Click Save Config.
  8. Click Flush Magento Cache under System > Tools > Cache Management for better results.
  9. Now you can view the different stores and the store views in the browser by specifying the corresponding URLs.

To integrate a language pack to differentiate the store views with various languages:

Step 1: Goto Find Partners & Extensions in the Admin Panel.

Step 2: Click Visit Magento Marketplace in the right bottom of the page.

Step 3: Search for the extension you need.

Step 4: Download the extension and unzip and extract the content into the specified magento root directory.

Step 5: Refer the documentation and steps given by the extension team and complete the process.

Example extension : Magenerds – de_de for german language pack.

Refer http://doc.magenerds.com/german-language-pack/ for the above extension integration.

Hope the blog was useful. Let us know your feedbacks and comments.

Be the first to Know

Subscribe to our blog to get the latest articles directly to your inbox.

READY TO DRIVE SALES?

Request a Quote Today

Request a Quote

Leave a Reply

5 Comments on "How To Setup Multiple Stores In Magento2?"


Guest
Jeremy
2 months 11 days ago

This is what I was looking for.
Can you tell me what are next steps to complete new store?

Thanks!

Guest
Gandhi
2 months 17 days ago

Very Useful article , how can i redirect specific store by country

Pooja Sekar
Author
2 months 12 days ago

Hi Gandhi,
Thanks for your feedback. You can redirect to the specific store by country based on the GeoIp recorded. There are several 3rd party extensions available to do the same. One among them is GeoIP Redirect for Magento 2

Guest
Aman
8 months 12 days ago

Good article its help me, i have a one question we don’t need to create sybonlink of app,pub,var,lib under new store.

Pooja Sekar
Author
8 months 4 days ago

Hi Aman,

Thanks for your feedback.
There is no necessity for creating any sybonlinks.
Please subscribe to our blogs.