Logo Questions Linux Laravel Mysql Ubuntu Git Menu

Magento redirect after login

I have a product page, in which users can login, like the website's facebook page and receive a discount for doing so.

I have everything working quite smoothly, except the mini-login.phtml file keeps redirecting the user to the account page.

Ideally, after login in, the user gets redirected to the page he/she was on. So that they can instantly click the 'facebook like' button after login in.

I've tried adding this code to the login form, didn't do anything.

<form action="<?php echo str_replace('login', 'loginPost', $this->helper('customer')->getLoginUrl()) ?>" method="post"> 

Is there a shortcode that'll allow me to redirect users to the same page they were on while loggin in?

like image 375
Jefferson Avatar asked Mar 19 '23 02:03


1 Answers

This is managed from the Magento Admin area. Log in and navigate to:

System > Configuration > Customer Configuration > Login Options

And select No for:

 Redirect Customer to Account Dashboard after Logging in
like image 143
James Avatar answered Apr 21 '23 13:04