|
estava a testar lojas multiplas de magento na versão 1.4 e descobri uma coisa fantastica!!
Não consegui trabalhar com aqui por ser demasiado simples.
nesta versão pelo que investiguei foram feitas alterações e tornaram tudo mais simples.
antigamente estes ----- http://www.magentocommerce.com/magento-on-the-fly/multiple-sites/ --- eram os passos a seguir mas tudo foi alterado para esta nova versão:
Home » Blogs » Lucjan Wilczewski’s blog
Setting up Magento with multiple websites or stores
10/12/2009 - 12:10 / Posted by Lucjan Wilczewski
There are many tutorials how to set Magento to work with multiple stores and make different domains point at each store. Since release of Magento CE 1.4.0.0-beta1 and Magento EE 1.6.0.0 it is even more easy to do.
Magento evolves
Solutions used in previous versions required developer to modify index.php file to handle different domains pointing at different stores. New index php contains 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);
So it checks two environmental variables and use them to start Magento runing. What does it give you? You can set now which store/website is supposed to be running under selected domain directly in virtual host definition or even htaccess.
VirtualHost solution
To benefit from this little piece of code it is enough for you to add following lines within your VirtualHost definition:
SetEnv MAGE_RUN_CODE “base” # put here your website or store code
SetEnv MAGE_RUN_TYPE “website” # put here ‘website’ or ‘store’
.htaccess solution
If you have no access to virtual host definitions, you can still try to use .htaccess for that, putting within following lines:
SetEnvIf Host .*yourhost.* MAGE_RUN_CODE="base";
SetEnvIf Host .*yourhost.* MAGE_RUN_TYPE="website";
Where .*yourhost.* is an regex expression matching the domain for which you want to set environmental variable.
So now you are capable of setting up your Magento multiple stores website without messing up with the core. Good luck.
MASW TENHO UMA DÙVIDA!!!
nestas linhas qual é a sintaxe correcta?
SetEnvIf Host .*yourhost.* MAGE_RUN_CODE="base";
SetEnvIf Host .*yourhost.* MAGE_RUN_TYPE="website";
bate tudo certo excepto isto e eu como um boi a frente de um palácio não vejo nada! é do sono!! ou da falta de conhecimentos básicos!!
alguém ajuda?
já agora este blog tem coisas giras.
t.s
|