我在Magento中使用事件调度时遇到了问题.
我正在使用controller_action_predispatch从URL中的参数设置前端会话变量.
现在,问题似乎是,当用户最初访问该网站时,他们可能会借助一个页面将其重定向到基本URL(例如example.com到www.example.com).但由于某种原因,重定向后,会话变量丢失了......
有任何想法吗?
谢谢.
编辑:
添加使用的代码:
public function grabRef($observer) {
$ref = Mage::app()->getRequest()->getParam('ref', $default);
if (isset($ref) && !is_null($ref) and !empty($ref)) {
Mage::getSingleton('core/session',array('name'=>'frontend'))->setRefid($ref);
}
}
Run Code Online (Sandbox Code Playgroud)