Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 从Magento中的观察者重定向_Php_Magento_Core - Fatal编程技术网

Php 从Magento中的观察者重定向

Php 从Magento中的观察者重定向,php,magento,core,Php,Magento,Core,我可以从Magento的observer重定向吗 管理会话\用户\登录\成功 这里我检查会话,如果会话已经创建,则重定向到同一页面,否则重定向到主页 如果是,那怎么办?请建议代码尝试以下方法: $controller = Mage::app()->getRequest()->getControllerAction(); $controller->getRequest()->setDispatched(true); $controller->getR

我可以从Magento的observer重定向吗

管理会话\用户\登录\成功

这里我检查会话,如果会话已经创建,则重定向到同一页面,否则重定向到主页


如果是,那怎么办?请建议代码

尝试以下方法:

   $controller = Mage::app()->getRequest()->getControllerAction();
   $controller->getRequest()->setDispatched(true);
   $controller->getResponse()->setRedirect(Mage::app()->getRequest()>getServer('HTTP_REFERER'));
   $controller->getResponse()->sendResponse();

祝你好运!愿原力与你同在。

你检查过这些了吗?你为什么要这么做?好像火车失事等着发生。