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.

2
  • 1
    you can find it by controller and action name in request Jan 19, 2017 at 12:12
  • thanx @GopalPatel got it
    – Taseen
    Jan 19, 2017 at 12:54

1 Answer 1

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
 }
1
  • exactly what i waiting for. thanx bro.
    – Taseen
    Jan 19, 2017 at 12:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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