How to set up multiple websites, stores, and store views in Magento 2

Last updated on May 31 2022
Raghvendra Wanchoo

Table of Contents

How to set up multiple websites, stores, and store views in Magento 2

Magento allows us to set up and manage multiple instances of stores or domains in a single Magento backend. In this blog, we will go through with how to set up multiple websites, stores, and store views in Magento 2.

Establishing multiple stores in a single Magento 2 backend is one of the variable functionalities that Magento 2 brings to store owners. This feature allows us to create several stores as many as we need in a single configuration. All the stores share the same domain, are set up as subdomains of the same domain, or have a completely different domain, yet possibly share the same backend for the easy administration.

Step 1: Create websites

  1. In the Magento 2 Admin panel, Go to Stores >> Settings >> All Stores.image1 15
  2. Stores page will appear in front of you, click on the Create Website.image2 14
  3. Enter the required information in the given field, such as Name, Code, and Sort Order, and click on the Save Websitebutton.image3 14
  4. Now, we can see that the website is created, which is visible on the Store page below the Main Website. Repeat these steps as many times as necessary to create your website.image4 14

Step 2: Create Stores

  1. In the Magento 2 Admin panel, Go to Stores >> Settings >> All Stores.
  2. Now, on the Stores page, click on the Create Storebutton to create the store.image5 14
  3. Fill the required information in the given fields follow the below instructions:
  4. Select the websitefrom the drop-down list, which is the parent of the new store. If there is only one website, then use the default, i.e., Main Website. Here we will select the Expert, which we have created in previous steps.image7 11
  5. Enter the Nameof the new store, just for the internal reference.
  6. In the Root Categoryfield, select a category for the main menu of the store. We will select Default Category here.

After completing the details of the store, click on the Save Store button.

image8 11

  1. Now, we can see that the Store is also created, which is visible on the Store page below the Main Website. Repeat these steps as many times as necessary to create your store.image9 9

Step 3: Create Store Views

  1. In the Magento 2 Admin panel, Go to Stores >> Settings >> All Stores.
  2. Now, on the Stores page, click on the Create Store Viewbutton to create the store view for your store.image10 8
  1. Fill the required information in the given fields.
  2. Select the store from the drop-down list to associate this store view.
  3. Enter the name in Name field to identify this store view.
  4. Provide a unique name in the Code field to identify this store view.image11 7
  5. Set the status to Enabled.image12 7
  6. Enter an optional numerical sort order.

Now, click on the Save Store View button to save the new store view information.

image13 7

  1. A pop up will open while saving the store view information. Click on OK and move ahead.image14 6Repeat the steps as many times as necessary to create the store view. In the below screenshot, you can see that the Store view is created for your new website and store.image15 5

Step 4: Setup the Store URL

In this step, we will configure the Store URL.

  1. On the left sidebar of Admin Panel, Go to Stores >> Settings >> Configuration.image16 5
  1. Here, select Webunder the General tab.image17 5
  2. Expand the URL Optionssection and set Yesto Add Store Code to URLs field and save. Therefore, wherever we will switch the store, the store code will come automatically appended with URL.image18 5On the upper left corner, select the Store Viewto check the new store that we added. From the Store View list, choose a website. We can get the information by selecting any store from the Store View drop-down list.image19 5

Click on OK to verify the scope switching.

  1. Now, expand the Base URLssection. Clear the Use Websitecheckbox, which is next to the Base URL field, and change the Base URL for the store. For example – https://subdomain.example.com/image20 5
  1. Open the Secure Base URLssection and set the store’s secure URL if needed.

Click on the Save Config button at the top of the page to complete.

In case, you have created the store and store view under Main Website similar to the below screenshot. Then follow the below instruction.

image21 5

Clear Cache Management

On the Admin Panel, Go to System >> Tools >> Cache Management.

Select all from the drop-down list, and click on the Flush Magento Cache button.

image22 5

Now, open the frontend and reload the webpage. Here, you can switch from one store to another store by clicking on the sub-domain of the Main Website Store. See in the below screenshot.

image23 5

The new store is:

image24 4

So, this brings us to the end of blog. This Tecklearn ‘How to set up multiple websites , stores , and store views in Magento 2’ blog helps you with commonly asked questions if you are looking out for a job in Magento Programming. If you wish to learn Java and build a career Java Programming domain, then check out our interactive, Java and JEE Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

https://www.tecklearn.com/course/java-and-jee-training/

Java and JEE Training

About the Course

Java and JEE Certification Training is designed by professionals as per the industrial requirements and demands. This training encompasses comprehensive knowledge on basic and advanced concepts of core Java & J2EE along with popular frameworks like Hibernate, Spring & SOA. In this course, you will gain expertise in concepts like Java Array, Java OOPs, Java Function, Java Loops, Java Collections, Java Thread, Java Servlet, and Web Services using industry use-cases and this will help you to become a certified Java expert.

Why Should you take Java and JEE Training?

  • Java developers are in great demand in the job market. With average pay going between $90,000/- to $120,000/- depending on your experience and the employers.
  • Used by more than 10 Million developers worldwide to develop applications for 15 Billion devices.
  • Java is one of the most popular programming languages in the software world. Rated #1 in TIOBE Popular programming languages index (15th Consecutive Year)

What you will Learn in this Course?

Introduction to Java

  • Java Fundamentals
  • Introduction to Java Basics
  • Features of Java
  • Various components of Java language
  • Benefits of Java over other programming languages
  • Key Benefits of Java

Installation and IDE’s for Java Programming Language

  • Installation of Java
  • Setting up of Eclipse IDE
  • Components of Java Program
  • Editors and IDEs used for Java Programming
  • Writing a Simple Java Program

Data Handling and Functions

  • Data types, Operations, Compilation process, Class files, Loops, Conditions
  • Using Loop Constructs
  • Arrays- Single Dimensional and Multi-Dimensional
  • Functions
  • Functions with Arguments

OOPS in Java: Concept of Object Orientation

  • Object Oriented Programming in Java
  • Implement classes and objects in Java
  • Create Class Constructors
  • Overload Constructors
  • Inheritance
  • Inherit Classes and create sub-classes
  • Implement abstract classes and methods
  • Use static keyword
  • Implement Interfaces and use it

Polymorphism, Packages and String Handling

  • Concept of Static and Run time Polymorphism
  • Function Overloading
  • String Handling –String Class
  • Java Packages

Exception Handling and Multi-Threading

  • Exception handling
  • Various Types of Exception Handling
  • Introduction to multi-threading in Java
  • Extending the thread class
  • Synchronizing the thread

File Handling in Java

  • Input Output Streams
  • Java.io Package
  • File Handling in Java

Java Collections

  • Wrapper Classes and Inner Classes: Integer, Character, Boolean, Float etc
  • Applet Programs: How to write UI programs with Applet, Java.lang, Java.io, Java.util
  • Collections: ArrayList, Vector, HashSet, TreeSet, HashMap, HashTable

Java Database Connectivity (JDBC)

  • Introduction to SQL: Connect, Insert, Update, Delete, Select
  • Introduction to JDBC and Architecture of JDBC
  • Insert/Update/Delete/Select Operations using JDBC
  • Batch Processing Transaction
  • Management: Commit and Rollback

Java Enterprise Edition – Servlets

  • Introduction to J2EE
  • Client Server architecture
  • URL, Port Number, Request, Response
  • Need for servlets
  • Servlet fundamentals
  • Setting up a web project in Eclipse
  • Configuring and running the web app with servlets
  •  GET and POST request in web application with demo
  • Servlet lifecycle
  • Servlets Continued
  • Session tracking and filter
  • Forward and include Servlet request dispatchers

Java Server Pages (JSP)

  • Fundamentals of Java Server Page
  • Writing a code using JSP
  • The architecture of JSP
  • JSP Continued
  • JSP elements: Scriptlets, expressions, declaration
  • JSP standard actions
  • JSP directives
  • Introduction to JavaBeans
  • ServletConfig and ServletContext
  • Servlet Chaining
  • Cookies Management
  • Session Management

Hibernate

  • Introduction to Hibernate
  • Introduction to ORM
  • ORM features
  • Hibernate as an ORM framework
  • Hibernate features
  • Setting up a project with Hibernate framework
  • Basic APIs needed to do CRUD operations with Hibernate
  • Hibernate Architecture

POJO (Plain Old Java Object)

  • POJO (Plain Old Java Object)
  • Persistent Objects
  • Lifecycle of Persistent Object

Spring

  • Introduction to Spring
  • Spring Fundamentals
  • Advanced Spring

Got a question for us? Please mention it in the comments section and we will get back to you.

 

 

0 responses on "How to set up multiple websites, stores, and store views in Magento 2"

Leave a Message

Your email address will not be published. Required fields are marked *