×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: bejoy balan
Added: Sep 16, 2014 9:49 AM
Views: 33
http://importantmagento.blogspot.in/2013/02/magento-redirect-to-login-page-if-user.html
  1. $req=Mage::app()->getRequest();
  2. $module = $req->getModuleName();
  3. $controller = $req->getControllerName();
  4. $redirect_url = Mage::getUrl('customer/account/login/');
  5. //$current_url = Mage::helper('core/url')->getCurrentUrl();
  6. if((!$this->helper('customer')->isLoggedIn()) && ($module=='catalog') && ($controller=='category')){
  7. Mage::app()->getFrontController()->getResponse()->setRedirect($redirect_url);
  8. }