Follow by Email

Sunday, April 12, 2015

Magento redirect to login page while user not login on landing

$redirect_url = Mage::getUrl('customer/account/login/');
$current_url = Mage::helper('core/url')->getCurrentUrl();
if((!$this->helper('customer')->isLoggedIn()) && ($current_url != $redirect_url)){
    Mage::app()->getFrontController()->getResponse()->setRedirect($redirect_url);
}

No comments:

Post a Comment