After login redirect user on previous page from front-end.
I am using the login pop-up and all default functionality. Also the Admin configuration Redirect Customer to Account is set as No. But it redirect me on Customer Dashboard
.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityAfter login redirect user on previous page from front-end.
I am using the login pop-up and all default functionality. Also the Admin configuration Redirect Customer to Account is set as No. But it redirect me on Customer Dashboard
.
We can config in Admin: STORES > Configuration > CUSTOMERS > Customer Configuration > Login Options > Redirect Customer to Account Dashboard after Logging in > No.
When enabled this config, the login url will have a referer param to base64 encode url, like: http://{website_url}/customer/account/login/referer/aHR0cDovL2xvY2FsaG9zdC9tYWdlMjE=/
Technically, we should take a look:
vendor/magento/module-customer/Controller/Account/LoginPost.php
public function execute()
{
......
return $this->accountRedirect->getRedirect();
}
vendor/magento/module-customer/Model/Account/Redirect.php
/**
* Retrieve redirect
*
* @return ResultRedirect|ResultForward
*/
public function getRedirect()
{
......
}
UPDATE: Please delete your local storage, this feature will work well. Please read more here.
Magento Version:
-Magento version 2.1.0
Set config setting in Admin:
STORES > Configuration > CUSTOMERS > Customer Configuration > Login Options > Redirect Customer to Account Dashboard after Logging in > No.
Also we have to enable Guest checkout.