For the creation of multistore magento we use following code
$mageRunCode = isset($_SERVER['MAGE_RUN_CODE']) ? $_SERVER['MAGE_RUN_CODE'] : '';
$mageRunType = isset($_SERVER['MAGE_RUN_TYPE']) ? $_SERVER['MAGE_RUN_TYPE'] : 'store';
Mage::run($mageRunCode, $mageRunType);
What will be the difference if we use website
instead of store
in $_SERVER['MAGE_RUN_TYPE'] : 'store';
code
Best Answer
I want to correct KESHAV_PHP here.
$_SERVER['MAGE_RUN_TYPE']
defines the type of entity which is used to select the store in the end. If you define a specific store by passing herestore
, then the store is loaded. This means espacially (in contradiction to what keshav wrote), that it doesn't matter wether the store is part of the default website or not.If you pass
website
, then the store is loaded which is default for the website.$_SERVER['MAGE_RUN_CODE']
defines the code of the website or store, as defined in the tablescore_website.code
andcore_store.code
.The whole process can be found here:
Where
getStoreByWebsite
only gets the default group and then callsgetStoreByGroup
which gets the default store for the group.