Magento 2 Store Locator - This tutorial is going to show you how to add and handle Multiple Shops on your Magento site. Multiple Shops functionality enables you to power any number of stores or websites within one Magento installation. It may be helpful if you are going to sell products on distinct domains sharing the same admin panel as well as to track your sales and clients without having to login to the admin area of every site. There a number of various ways to enable the Multi Shop Functionality. It’ll be additionally useful if you are going to operate the sites under two domains as well.
Creating Categories: Sign into your Magento admin panel. If you need both your sites to share same Default Category, choose it by clicking on it on the left. Or click Add Root Class to create a brand new root class distinct from the existing one. After the class is selected, under the General Information set Is Active to Yes. Under the Screen Settings tab in the dropdown set Is Anchor to Yes. Name - domain name of the new site Code - a parameter that may be utilized in establishing the Apache web server to point to that specific domain name Click Save Website.
Go to System -> Manage Stores and click the Create Store button. In the Web site dropdown select the website the Name which you created before. Enter aName - the same as the second site name Choose a Root Class in the drop down- the root class that may be used for this store. In the Store drop-down choose the archive in which this view will be connected with. In the Code field enters a distinctive code for this store locator. Select the state - if enabled, this store locator may be available from our front-end, otherwise, it won’t be available Click Save Store View.
Php file and also the .htaccess file from the Magento folder over to the magento2 folder. In case you’re utilizing a distinct domain - copy these files to the root folder or your other domain). Php file and look for the following line $mageFilename = app\/Mage. Php Save the changes Open the copied .htaccess file. Add the following to the end of itSetEnv If Host.base. Where magento2 is the website code taken from Step2 point 2 of this tutorial.
Source: Magento 2 Store Locator