Open header.phtml add this code at top of the file
if(!Mage::helper('customer')->isLoggedIn()) {
$loginback=$this->helper('core/url')->getCurrentUrl();
$check=strstr($loginback, 'customer/account/login');
if(!strlen($check)){
Mage::getSingleton('core/session')->setLoginBackUrl($loginback);
}
}
Override app\code\core\Mage\Customer\controllers\AccountController.php to you local or custom module and add this function.
protected function _loginPostRedirect()
{
$session = $this->_getSession();
$backUrlcustom=Mage::getSingleton('core/session')
->getLoginBackUrl();
if(isset($backUrlcustom) && $backUrlcustom !=""){
$session->setBeforeAuthUrl($backUrlcustom);
}
$this->_redirectUrl($session->getBeforeAuthUrl(true));
}

Không có nhận xét nào:
Đăng nhận xét