在Magento中没有GET参数的切换存储

kri*_*fur 0 php redirect magento

我想从一个商店到另一个商店(我设置多个商店)进行一个不可见的重定向到我的模块,现在我正在使用这个代码片段,但它显示了GET参数:

echo '<p><a href="' . Mage::getUrl() . '?___store=' . $store . '">pick up this restaurant</a></p>'
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?

谢谢

Kan*_*tel 11

你必须COOKIE为商店设置

例如 :

Mage::app()->setCurrentStore($storeViewId);
Mage::app()->getCookie()->set(Mage_Core_Model_Store::COOKIE_NAME, 'de', TRUE);

de = Store code.
Run Code Online (Sandbox Code Playgroud)