I found this file /vendor/magento/module-customer/Controller/Account/LoginPost.php file is having some code. What is the explanation of below code?

magento.stackexchange https://magento.stackexchange.com/questions/335321

Question

I want to know what actually these two lines of code are doing.

    $redirectUrl = $this->accountRedirect->getRedirectCookie();
    if (!$this->getScopeConfig()->getValue('customer/startup/redirect_dashboard') && $redirectUrl) {
Était-ce utile?

La solution

The code above will Magento (after passing the conditions) to redirect the customer to the route saved in the redirect cookie after successful login if the configuration which says that all customers be redirected to their accounts' dashboard instead Stores -> Configuration -> Customers -> Login Options -> Redirect Customer to Account Dashboard after Logging in is not enabled.

See class vendor/magento/module-customer/Model/Account/Redirect.php for more details on how the redirect route is used.

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top