C O D I T R O N

Technologies

Multi-Website & Multi-Store in Magento 2

By, Sanyogita Salunkhe
3rd January 2023

Hello Viewers, hope you are doing well. Did you know that Magento allows you to set up multi websites & multi-store for your single-installed Magento?
Let me explain to you how you can create multiple websites and stores with simple configurations.

The hierarchy is like this, a Magento instance can contain multiple websites, a single website can have multiple stores and a store can have multiple store views with multiple languages.

So, in this blog, we are going to take a look at how to create multiple websites & multiple stores in Magento 2.

Here are some simple steps to follow:

Step 1: Create root categories.
Step 2: Create websites.
Step 3: Create stores.
Step 4: Create store views.
Step 5: Configure the website base URL.
Step 6: Add the store code to the base URL.
Step 7: Change the default store views base URL.

Step 1: Create Root Categories:

To create a root category:

1) Login to the Admin Panel.
2) Click Catalog > Categories.
3) Click Add Root Category. 
4) In the Category Name field, enter a unique name to identify this category.
5) Make sure that Enable Category is set to “Yes”.
6) Click on the “Save” button.

Step 2: Create Websites:

To create websites:

1) Login to the Admin Panel.
2) Click Stores > Settings > All Stores.
3)On the Store page, Click on Create Website button.

4)Choose a Validation Strategy to determine how the system will process when any error occurs.

#1-Stop on Error: The system stops importing data when an error occurs.
#2-Skip error entries: The system skips all the errors and continues to import.

  1. Name – Enter a name to identify your website.
  2. Code – Enter a code which is unique for every website.
  3. Sort Order – Enter a sort order number which is optional.

Click on the Save Web Site Button.

Step 3: Create Stores:

To create Stores-
1) Login to the Admin Panel.
2) Click Stores > Settings > All Stores.
3) On the Store page, Click on Create Store button.

  1. Web Site – Click the name of the website with which to associate this store.
  2. Name – Enter a name to identify your store.
  3. Code – Enter a code which is unique for every store.
  4. Root Category – Select the name of the category for this store.

4) Click on Save Store Button.

Step 4: Create Store Views:

To create Stores-

1) Login to the Admin Panel.
2) Click Stores > Settings > All Stores.
3)On the Store page, Click on Create Store Views button.

  1. Store – Click the name of the store with which this store view is associated.
  2. Name – Enter a name to identify your store view.
  3. Code – Enter a code which is unique for every store view.
  4. Status– Select the status Enabled to enable your store.

4)Click on Save Store View Button.

Step 5: Change the Website base URL:

1)Login to the Magento Admin panel. 
2)Go to Stores > Settings > Configuration. Then under the General section click on the web.
3)At the top of the page, from the store view list select your website.
4)Enlarge the Base URLs option.
5)Enter the http://coditronwebsite.com/ Url in the Base Url and Base Link URL.
6)Enlarge the Base URLs (Secure) option.
7)Enter the http://coditronwebsite.com/ Url in the Secure Base Url and Secure Base Link URL.
8)Click Save Config.

Step 6: Add the store code to the base URL:

Commerce gives you the option to add the store code to the site base URL, which simplifies the process of setting up multiple stores. Using this option, you do not have to create directories on the Commerce file system to store index.php and .htaccess.

To add the store code to the base URL:
1)Login to the Magento Admin Panel.
2)Click on Stores > Settings > Configuration > General > Web
3)At the top of the page, from the store view list select Default Config.

4)Click on General > Web > Url Options .
5) Then select Yes from the checkbox for Add Store Code to URLs.
6)Click Save Config.
7)If prompted, flush the cache. (System > Cache Management).

Step 7: Change the default store view’s base URL:

You must perform this step last because you will lose access to the Admin; your access returns after you set up virtual hosts as discussed in the web-server-specific topics.
1)Login to the Magento Admin Panel
2)Click on Stores > Settings > Configuration > General > Web
3)At the top of the page, from the store view list select Default Config.
4)Enlarge the Base URLs option and enter your website’s base URL.
5)Click Save Config.

Now go to the URLs that you have set up for your new store/website and see if everything works properly.

Now go to the URLs that you have set up for your new store/website and see if everything works properly.

Conclusion:

In this blog, we have learnt about Magento websites, stores, and store views. And these are the fundamental factors for store owners to start their e-commerce business. So as per your business requirements, you can create multiple websites, stores, and store views.

Hope this helps you understand the difference between Magento websites, stores, and store views.

Leave a Comment

Coditron Technologies

Address

Corporate Office : Greens Center, Thergaon Pune 411033

Operation Office: USA: PO Box # 582973 ElkGrove CA 95758