Jump to content
AdamB15

Redirect after Login - 1.6

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

Share this post


Link to post
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

Share this post


Link to post
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 ;) 

Share this post


Link to post
Share on other sites

Unless there is a very specific need, after login the user should be redirected back to the original page.

 

Prestashop apparently doesn't include this feature, at least in 1.6.0.11.

Share this post


Link to post
Share on other sites

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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More