What is Magento Multistore? Using Multistore to Expand Business

What is Magento Multistore

Magento Multistore: is a solution for your store if you want to manage more than one stores share the same Magento installation. Usually, your store will target and segment a group of customers, when you want to segment another group, you should use the multistore feature of Magento. Magento multistore help you manage your store better with low cost. Example, you want to have 2 pet stores: one is land pet and another is sea pet, you don't need to develop another Magento backend, Magento multistore will separate the main store to two stores with one backend. To explain it, I will clarify below:

It is a hierarchy with 3 elements:

Websites: you can create multiple websites, in WordPress and another not eCommerce platform, it calls multisite. With multisite, you can add more domain/subdomain or keep the old domain, you can also have multiple domains on a single installation. Besides, somethings can change like:

  • Prices
  • Tax
  • Currency
  • Payment Option
  • Shipping Option
  • It contains customer data, you can choose to keep in on all your system or separate it.

Store: store are “children” of website, each website can manage multiple Magento store. Some points to notice:

  • All The Store Within A Website Share The Same Customer Account
  • Currency And Prices Are The Same On All Store
  • Different Shop Can Have Different Product Assigns.

Store views: it is usually used to manage your language on your website, a store can have many Store Views. For example, your products selling in two places: America and Mexico, so you should create two store views to display English and Spanish and it also can change the theme

Case example: Nespresso is a global company using Magento, and it is “children” of Nestle’s website. In Nespresso, we can see that it has many stores, not only they sell the coffee, but also they sell machine, accessories, etc. And it also has many Store Views for many countries.

How to Create Multistore:

Before doing this practice, you need to make sure that, you have two domains pointing to same the path on your hosting. In my localhost, I have two domains named:

http://wp2cart.com/magento23/

https://wp2cart.com/ns

    • Step 1: Create New Category

magento-multistore

    • Step 2: Create a New Website

magento-multistoremagento-multistore

    • Step 3: Create a new Store for the New

magento-multistoremagento-multistore

    • Step 4: Create Store View for the second website

magento-multistoremagento-multistore

    • Step 5: Setup the Base URL for the new website

magento-multistoremagento-multistoremagento-multistoremagento-multistore

  • Step 6: Set values for the MAGE_RUN_TYPE and MAGE_RUN_CODE

Open the index.php file under application root directory Replacing this code:

$bootstrap =\Magento\Framework\App\Bootstrap::create(BP, $_SERVER);

by these codes:

switch($_SERVER['HTTP_HOST']) {
case 'website.vn':
$mageRunCode = 'base';
$mageRunType = 'website';
break;
case 'website.us':
$mageRunCode = 'second';
$mageRunType = 'website';
break;
}
$params = $_SERVER;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = $mageRunCode;
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = $mageRunType;
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);

 

When you add new products, in the add new product page, scroll down to the Product in Websites section, choose what website you would like to show your

magento-multistore