1

Authentication popup is the login popup that will appear if customer who are not logged in press Proceed to Checkout button in cart page.

For default, when customer sign in using authentication popup they will be redirected to the previous page (cart page).

I want to modify the redirect url after customer sign in from authentication pop up, they'll redirected to custom page. I have trying to locate the form action in Magento_Customer/view/frontend/web/js/view/authentication-popup.js but i can't find it.

1

Your path should be : app/design/frontend/Vendor/Theme/Magento_Customer/web/js/view/authentication-popup.js

For the simple way, we can set the redirect url in our custom js - authentication-popup.js:

        /** Provide login action */
        login: function (loginForm) {

          ...... 
                this.isLoading(true);
                loginAction(loginData, null, false); // We can set the redirect here
          ......
        }

Take the look the loginAction method - Magento_Customer/js/action/login.

                   if (redirectUrl) {
                        window.location.href = redirectUrl;
                    } else if (response.redirectUrl) {
                        window.location.href = response.redirectUrl;
                    } else {
                        location.reload();
                    }

As we can see, if we set the redirect url by default, Magento site will use it for redirecting.

For the redirect Url, we can read more here: https://magento.stackexchange.com/a/131227/33057

  • yes, i have created authentication-popup.js in that directory. now i want to change the redirect url after customer login. – Seventh St Feb 10 '17 at 16:18
  • Which the redirect url you want after customer login? – Khoa TruongDinh Feb 10 '17 at 16:20
  • to checkout page. – Seventh St Feb 10 '17 at 16:24
  • You should read more here: magento.stackexchange.com/a/131227/33057 – Khoa TruongDinh Feb 10 '17 at 16:25
  • 1
    @KhoaTruongDinh I don't think modifying code library is good Idea... We should use mixin to achieve this – BEJGAM SHIVA PRASAD Sep 26 '17 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.