How to Setup Magento 2 Multi Store

How to Setup Magento 2 Multi Store

Magento 2 facilitates to setup multiple stores. It is needed when a store owner decides to expand the business or wants to manage multiple stores from a single administration or establish stores for more than one locations. Magento 2 Multi Store setup benefits in many ways, such as:

  • Using single payment gateway in all the stores to save cost.
  • You can get unified support for all the created stores while using third party extensions and integrations.
  • Boilerplate content for the pages like terms and conditions, privacy policy, etc.
  • Retain a common customer database to use in all the stores.
  • Useful in the responsive frameworks.

Magento 2 Multi Store setup facility allows creating as many stores as you need in the single configuration.

Steps to Setup Magento 2 Multi Store:

  1. Create a New Website
    1. Login to Magento Backend
    2. Navigate to Store > Settings > All Stores.
    3. On the Stores page, click Create Website.
      1. Name: Enter your website name.
      2. Code: Enter the unique code for the website.
      3. Sort Order: It is an optional field and is set to maximum value ‘0’ by default.
    4. Save Web Site.1_Create-a-Website
  2. Create a New Store
    1. Navigate to 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. Save Store.2_Create-New-Store
  3. Create a New Store View
    1. Navigate to 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. It is set to maximum value ‘0’ by default.
    4. Save Store View.3_Create-New-StoreView
  4. Check for Mode and Access PermissionsNote: Only beginners need to check for this step. It is required to enable the developer mode.
    1. Give permissions to the below directories.
    2. The command to change the mode is,
      Alternative Method:

      1. Go to app/etc/ and open env.php
      2. Change current application mode by MAGE_MODE’ => ‘default’ to MAGE_MODE’ => ‘developer’.
  5. Create a New Website
    1. Create folder from your root directory eg. demo5, and 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:
    3. In the Admin, navigate to 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.
      1. Base URL : Enter the base URL.
      2. Base Link URL : Enter base link URL.
      3. Base URL for Static View Files(default value) :Enter URL for static view files.
      4. Base URL for User Media Files(default value) :  Enter URL for media files.Fill the same in the fields under Base URLs (Secure) if needed for ‘https’ access.4_Base-URLs
  6. Save Config.
  7. Navigate to System > Tools > Cache Management and click Flush Magento Cache.
  8. Now you can view the different stores and the store views in the browser by specifying the corresponding URLs.
  9. Using SSH, create the following symbolic links in the document root of your new domain, and replace the path below with the full path to the document root of your Magento Installation:

  10.  If you have successfully configured your secondary domain to work with Magento, your new domain will load in your browser, and you may begin developing your new store.

Follow this stepwise tutorial and you’re all ready to setup Magento 2 multi store!

It being a lengthy tutorial, if you face a problem in implementation at any step, please post your doubts in the Comments section. I’d be happy to help you out.

Rate the tutorial with 5 stars if found helpful 🙂

All the best for your multi stores ?

Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

(based on 13 Reviews)

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. Owing to his contributions in Magento Forums and posting solutions, he is among the top 50 contributors of the Magento community in 2019. When he is not engrossed with anything related to Magento, he loves to play cricket.

Leave a reply:

Your email address will not be published.