0

Currently at the checkout, if you enter an email that has already been registered in the system, Magento ask you to enter your password.

This is a problem because many customers don't remember their passwords.

How could I remove this login from the checkout? (i.e even if the email has been used before, allow to checkout normally without needing to log in)

3
  • In Magento 2, if the email has been registered, you are asked to log in, but not forced to log in. Feb 21, 2018 at 8:47
  • I understand. But it confuses costumers. I would really like Magento to not ask at all. Feb 21, 2018 at 8:53
  • 1
    Please check my answer. Feb 21, 2018 at 9:27

1 Answer 1

4

You need to override vendor/magento/module-checkout/view/frontend/web/js/view/form/element/email.js file in your theme and force self.isPasswordVisible(false);.

Around line 58, you will find the code like below:

/**
 * Callback on changing email property
 */
emailHasChanged: function () {
    var self = this;

    clearTimeout(this.emailCheckTimeout);

    if (self.validateEmail()) {
        quote.guestEmail = self.email();
        checkoutData.setValidatedEmailValue(self.email());
    }
    this.emailCheckTimeout = setTimeout(function () {
        if (self.validateEmail()) {
            self.checkEmailAvailability();
        } else {
            self.isPasswordVisible(false);
        }
    }, self.checkDelay);

    checkoutData.setInputFieldEmailValue(self.email());
},

You need to change it like below code:

/**
 * Callback on changing email property
 */
emailHasChanged: function () {
    var self = this;

    clearTimeout(this.emailCheckTimeout);

    if (self.validateEmail()) {
        quote.guestEmail = self.email();
        checkoutData.setValidatedEmailValue(self.email());
    }


    // this.emailCheckTimeout = setTimeout(function () {
    //     if (self.validateEmail()) {
    //         self.checkEmailAvailability();
    //     } else {
    //         self.isPasswordVisible(false);
    //     }
    // }, self.checkDelay);
    self.isPasswordVisible(false);

    checkoutData.setInputFieldEmailValue(self.email());
},
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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