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)

  • In Magento 2, if the email has been registered, you are asked to log in, but not forced to log in. – Mohit Kumar Arora Feb 21 '18 at 8:47
  • I understand. But it confuses costumers. I would really like Magento to not ask at all. – Jurģis Toms Liepiņš Feb 21 '18 at 8:53
  • 1
    Please check my answer. – Mohit Kumar Arora Feb 21 '18 at 9:27
3

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());
},

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.