Jump to content

Redirect after Login - 1.6


AdamB15

Recommended Posts

Hey all,

I've had a search for this already however could only find answers for previous versions and didn't want to risk breaking my store!

 

Currently when a customer logs in, they are taken to their account. However, we would prefer it if they were instead taken to the homepage. How do I go about changing it so that once they have logged in, they are taken to the homepage, rather than my-account ? 

 

Many thanks

Adam

Link to comment
Share on other sites

I think you will have to override your AuthController. Look for processSubmitLogin(). In this function you should find a redirect to "my-account", in case that no "back" parameter is given. Change this to something like:

$link = new Link();
Tools::redirect($link->getPageLink("index"));

Not tested, but shouldn't be too wrong :D

Edited by imagetag (see edit history)
  • Like 1
Link to comment
Share on other sites

This is the only bit I could find within that function - do I need to add the code above?

 if (!$this->ajax && $back = Tools::getValue('back')){
if ($back == Tools::secureReferrer(Tools::getValue('back')))
Tools::redirect(html_entity_decode($back));


$back = $back ? $back : 'my-account';
Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? urlencode($this->authRedirection) : $back));
}

I see that it's got the 'my-account' but it looks different from what you've put - will leave it as is for now in case of breaking it all ;) 

Link to comment
Share on other sites

  • 2 months later...
  • 5 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...