Magento 2 Multi Store Setup – The Best Guide For Beginners

by admin

Magento supports the multi store function, which allows you to create as many stores as you need only in the single installed Magento. Your Magento 2 multi store can share the same domain and be set up as subdomains, or have entirely different domains. And those stores share the same backend, making it easier to manage.

And in this article, we will show you the best Magento 2 multi store setup tutorial to help you enable this amazing feature.

Let’s go!

Benefits of Magento 2 Multi Store

Magento 2 multi store feature enables you to start multiple websites or store views that use different attributes and content, such as:

  • Default languages
  • Domain names
  • Categories
  • Products
  • Currencies

magento-multistore

For example, you can have a store for customers in England, with English as the default language and GBP as the base currency, and a store for customers in France, with France as the default language and EUR as the base currency.

Or you can have a store that sells women’s clothes and a store that sells men’s clothes.

Thus, setting up Magento 2 multi stores is a must for store owners who want to expand their business. It allows them to manage multiple stores (for multiple purposes) from a single administration.

Here are some benefits of setup Magento 2 multi store:

  • Using one payment gateway for multiple stores to save cost.
  • Get unified support for third party extensions and integrations for all stores
  • Sync content for the pages like terms and conditions, privacy policy, etc.
  • Retain a common customer database to use in all stores

READ MORE: Magento Multistore – a must-have weapon to multiply sales!

Magento 2 Multi Store Setup – The Full Guide

Follow these steps below to set up the Magento 2 multi store for your business.

Create new website, store, and store view

Create new website

To create a website:

Go to Stores > Settings > All Stores.

On the Stores page, click Create Website.

Fill the fields with your website information:

  • Name: Enter a name to identify the website
  • Code: Enter a unique code (e.g: if you have a French store, you can enter french)
  • Sort Order: Enter an optional numerical sort order

magento-create-website

Then click Save Web Site.

Create new store

Go to Stores > Settings > All Stores.

On the Stores page, click Create Store.

Fill the fields with your store information:

  • Web Site: Click the name of the website with which to associate this store
  • Name: Enter a name to identify the store
  • Code: Enter a unique code to identify the store
  • Root Category: Click the name of the root category for this store

magento-create-store

Then click Save Store.

Create new store view

Go to Stores > Settings > All Stores.

On the Stores page, click Create Store View.

Fill the fields with your store view information:

  • Store: Click the name of the store with which to associate this store view
  • Name: Enter a name to identify this store view
  • Code: Enter a unique name to identify this store view
  • Status: Select Enabled

magento-create-store-view

Then click Save Store View.

Change the website base URL

To access a website using a unique URL (e.g: http://french.magento.mg), you must change the base URL for each site in the backend.

Go to Stores > Settings > Configuration > General > Web.

From the Store View list at the top of the page, click the name of one of your websites.

website-base-URL

Expand Base URLs section.

Untick Use Default for Base URL and Base Link URL, then enter http://french.magento.mg URL in the Base URL and Base Link URL fields.

change-base-URL

Repeat those steps in the Base URLs (Secure) section.

change-base-URL-secure

Then click Save Config.

Create Apache virtual hosts

Next step in the Magento 2 multi store setup process, you need to create Apache virtual hosts per Commerce website.

In this tutorial, we will show you how to set values for MAGE_RUN_TYPE and MAGE_RUN_CODE using the Apache server variable SetEnvIf in a virtual host.

To create Apache virtual hosts

Open the virtual host configuration file in a text editor as a user with root privileges.

For example, open /etc/httpd/conf/httpd.conf

Then locate the section starting with <VirtualHost *:80>.

Create the following virtual hosts after any existing virtual hosts:

<VirtualHost *:80>
   ServerName          mysite.mg
   DocumentRoot        /var/www/html/magento2/pub/
</VirtualHost>

<VirtualHost *:80>
   ServerName          french.mysite.mg
   DocumentRoot        /var/www/html/magento2/pub/
   SetEnv MAGE_RUN_CODE "french"
   SetEnv MAGE_RUN_TYPE "website"
</VirtualHost>

<VirtualHost *:80>
   ServerName          german.mysite.mg
   DocumentRoot        /var/www/html/magento2/pub/
   SetEnv MAGE_RUN_CODE "german"
   SetEnv MAGE_RUN_TYPE "website"
</VirtualHost>

Save your changes to httpd.conf and exit the text editor.

Finally, restart Apache:

  • CentOS: service httpd restart
  • Ubuntu: service apache2 restart

Verify your site

Unless you have DNS set up for your stores’ URLs, you must add a static route to the host in your hosts file:

First, you need to locate your operating system hosts file.

Then add the static route in the format:

<ip address> french.mysite.mg
<ip address> german.mysite.mg

Your Magento website and multistore will have the URLs as follows:

  • http://mysite.mg/admin
  • http://french.mysite.mg/frenchstoreview
  • http://german.mysite.mg/germanstoreview

And the Magento 2 multi store setup process is done. Your new store is ready for deployment.

Best Solutions To Enhance Magento 2 Multi Store

Optimize your Magento 2 multi store even more with these highly recommended solutions.

Magento 2 Multiple Store View Pricing

magento-2-multiple-store-view-pricing

Magento 2 Multiple Store View Pricing allows you to set up different prices for the same product on each Magento store view. It also supports setting up base currency per store view easily.

With this powerful extension, you can attract specific customers with different pricing strategies for each store view.

EXPLORE MORE: How to optimize Magento Multi Store View Pricing!

Magento 2 Tax per Store View

magento-2-tax-per-store-view

Magento 2 Tax per Store View allows you to charge specific taxes for the same product per Magento 2 store view.

This is an ideal solution for Magento multiple stores to charge local consumers specific taxes.

Magento 2 Shopping Cart Price Rule per Store View

shopping-cart-price-rule-per-store-view-m2

Magento 2 Shopping Cart Price Rule per Store View allows you to set up shopping cart price rules and catalog price rules for each store view.

This extension allows store owners to offer specific promotions to their local customers to persuade them to buy more and increase sales.

Conclusion

In this article, we have shown you the best Magento 2 multi store setup tutorial and also introduced you to some great Magento 2 multi store solutions to enhance your business.

LEARN MORE: All about Magento 2 Multiple Websites – Multi Stores – Store Views!

We hope this is helpful and good luck to you!

BSS Commerce is one of the world’s leading Magento extension providers and web development services. With professional and experienced Magento developers, we promise to deliver high-quality goods and services to enhance your business successfully. For every Magento extension, we also provide FREE Installation, FREE 1-year Support, and FREE Lifetime Updates.

CONTACT NOW to let us know your problems. Every time, you can count on our support.

 

Next Reading Suggestions

© 2019 BSS Commerce owned by THANH CONG INTER ., JSC. All Rights Reserved.
Business registration certificate no. 0106064469 issued by Hanoi Department of Planning and Investment on 19 December 2019.
Legal Representative: Mr. Nguyen Quang Trung.