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

Pregunta

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) {
¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a magento.stackexchange
scroll top