Magento redirects after login

I have a product page in which users can log in, for example, on the facebook page on the site and get a discount for this.

Everything works fine for me, except that the mini-login.phtml file redirects the user to the account page.

Ideally, after logging in, the user is redirected to the page on which he was included. So that they can instantly click the "facebook like" button after logging in.

I tried adding this code to the login form, did nothing.

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

Is there a short code that will allow me to redirect users to the same page on which they were included at login?

+4
source share
1 answer

This is managed from the Magento administration area. Log in and go to:

System > Configuration > Customer Configuration > Login Options

And select Nofor:

 Redirect Customer to Account Dashboard after Logging in
+7
source

Source: https://habr.com/ru/post/1547907/


All Articles