Magento; dispatch multi store
I've set up the following multi site structure in Magento (1.3.2.4);
Site | Store | View -------------------------- Site A | Store A | View A Site B | Store B | -
So, 2 site codes and 1 view code.
- Is the (empty) view of Store B inherited from Store A?
- And what if "Store B" was left blank, would that inherit the root category of "Store A"?
My major question
I want to dispatch a certain store/site by code, respectively my site开发者_Python百科 codes are 'site_a' and 'site_b'.
I have a filesystem that looks like this (goal is not to customize the magento directory).
./sites/site_a/.htaccess
./sites/site_a/magento/'setEnv MAGE_RUN_CODE site_a' is added to my htaccess in the root of site_a (found this on internet, im not sure of this is implemented by magento..)
I expected switching the RUN_CODE to 'site_b' would load 'Site B' at /site_a/magento/, but it doesn't.
Any help is appreciated :-)
// Roland
Edit: Offcourse $_SERVER['MAGE_RUN_CODE'] exists (with the correct value and matching the configured value) in /site_a/magento/.
Im getting this feeling its not implemented :-)
Depending on your version of Magento, it may not be implemented by default and you will need to add some extra code to the bottom of Magento's index.php:
$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);
If using the codes from the websites (not the store views) then you will need to set MAGE_RUN_TYPE to 'website'.
I believe you will also need to set a store view for website B as it will not be inherited from website A.
精彩评论