3

i am using magento 1.9.2.4 and i am creating a module that will check if page is not registration page or login then it will redirect to home page is there any way to know that if current page is login page or customer registration page ? thanx in advance.

  • 1
    you can find it by controller and action name in request – Gopal Patel Jan 19 '17 at 12:12
  • thanx @GopalPatel got it – Taseen Jan 19 '17 at 12:54
4

You can call below function in your template and get page info in magento 1 ,

 $request = $this->getRequest();
 $modulename = $request->getModuleName();
 $controller = $request->getControllerName();
 $action = $request->getActionName();
 if($modulename == 'customer' && $controller == 'account' && $action == 'login')
 {
   //login page
 }

  if($modulename == 'customer' && $controller == 'account' && $action == 'create')
 {
   //registration page
 }
  • exactly what i waiting for. thanx bro. – Taseen Jan 19 '17 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.