In magento most uaseful functionality is multiple website. To create multiple wesite in magento follow the following steps.
Stepl-1 Create Root category for other website.
Go To Catalog -> Manage Category and click on "Add Root Category" Button and create root category.
in root category you can add category for other website.
Step-2 Create Wesite , Store & Store view.
Go To System -> Manage stores -> Click on "Create Website" Button
It open new form in form two field vaialable Name & Code
Add Name & Code in form save it.
Note: I have added Name Website2 & Code = wesite2 for example purpose
Next create a store click on create "Create Store" button then open new form in that three field available Website , Name & Root category.
Select a website from Website field. Next add store name in Name field & Select category form Root Category field.
Next create store view clicking in "Create Store View" button. it open new for store view. in that Store , Name , Code , Status , & Short Order field are available.
Select store form Store field. Add name of store view in Name field & add store code & select status from status field.
Finally save store view form.
Step-2 Create website folder in root directory.
create wesite folder (in my case folder name is website2) in root directory add index.php & .htaccess file in website folder from root.
Next Open index.php
Change following lines
$compilerConfig = MAGENTO_ROOT . '/includes/config.php'; // (Approximate line no : 47)
Replace with
$compilerConfig = MAGENTO_ROOT . '/../includes/config.php';
$mageFilename = MAGENTO_ROOT . '/app/Mage.php'; // (Approximate line no : 52)
Replace with
$mageFilename = MAGENTO_ROOT . '/../app/Mage.php';
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : ''; // (Approximate line no : 82)
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store'; // (Approximate line no : 85)
Replace with
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'website2'; // Adding website code here
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'website'; // Adding website keyword
Step-3 Set Website Path in System Configuration.
Finally set website path in configuration.
Go System -> Configuration -> Select New website (Website2) form Current Configuration Scope Dropdown
After that Go to System -> Configuration -> General -> Web -> Unsecure Section Add website code name at last in 'Base URL' textbox.
Now clear the cache & create index management. then check in browser
Stepl-1 Create Root category for other website.
Go To Catalog -> Manage Category and click on "Add Root Category" Button and create root category.
in root category you can add category for other website.
Step-2 Create Wesite , Store & Store view.
Go To System -> Manage stores -> Click on "Create Website" Button
It open new form in form two field vaialable Name & Code
Add Name & Code in form save it.
Note: I have added Name Website2 & Code = wesite2 for example purpose
Next create a store click on create "Create Store" button then open new form in that three field available Website , Name & Root category.
Select a website from Website field. Next add store name in Name field & Select category form Root Category field.
Next create store view clicking in "Create Store View" button. it open new for store view. in that Store , Name , Code , Status , & Short Order field are available.
Select store form Store field. Add name of store view in Name field & add store code & select status from status field.
Finally save store view form.
Step-2 Create website folder in root directory.
create wesite folder (in my case folder name is website2) in root directory add index.php & .htaccess file in website folder from root.
Next Open index.php
Change following lines
$compilerConfig = MAGENTO_ROOT . '/includes/config.php'; // (Approximate line no : 47)
Replace with
$compilerConfig = MAGENTO_ROOT . '/../includes/config.php';
$mageFilename = MAGENTO_ROOT . '/app/Mage.php'; // (Approximate line no : 52)
Replace with
$mageFilename = MAGENTO_ROOT . '/../app/Mage.php';
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : ''; // (Approximate line no : 82)
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store'; // (Approximate line no : 85)
Replace with
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : 'website2'; // Adding website code here
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'website'; // Adding website keyword
Step-3 Set Website Path in System Configuration.
Finally set website path in configuration.
Go System -> Configuration -> Select New website (Website2) form Current Configuration Scope Dropdown
After that Go to System -> Configuration -> General -> Web -> Unsecure Section Add website code name at last in 'Base URL' textbox.
Now clear the cache & create index management. then check in browser
No comments:
Post a Comment