Jump to content

After login redirect to specific category page


vmish75

Recommended Posts

authcontroller.php, line 329

 

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

 

Just get the page you prefer ;)

Thanks for your reply.

 

I have checked but not working. still redirect to my-account page

 

Please can you tell me this step by step. I am new in prestashop

Link to comment
Share on other sites

Can you check if the back value is set?

if (!$this->ajax)
{
if ($back = Tools::getValue('back'))
Tools::redirect(html_entity_decode($back));
Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? url_encode($this->authRedirection) : 'my-account'));
}
 
You can also get rid of that
 
				if (!$this->ajax)
				{
					Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? url_encode($this->authRedirection) : 'my-account'));
				}
Link to comment
Share on other sites

  • 2 weeks later...

Thanks for your reply.

 

I have checked but not working. still redirect to my-account page

 

Please can you tell me this step by step. I am new in prestashop

 

Do a search for this line of code in the AuthController.php page:

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

Change 'my-account' to the page you want it redirecting to (for instance, I changed all mine to 'index' to make users go to the homepage after logging in.)

 

If it doesn't work, try doing the same thing in the AuthController.php that's inside override > controllers > front.

 

You may also need to do what Nemo1 said above (removing one line of code.)

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...