0

This question already has an answer here:

Currently, in Magento 2 the login form is visible only when I enter an email address, that only if there is an account on the system.

I want to show the login form even if the user doesn't enter his email address.

marked as duplicate by Manashvi Birla, Jai, Muhammad Hasham, Piyush, denish vachhani Apr 29 at 9:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • which login form is this, the one on top? – fmsthird Apr 29 at 5:22
  • yes. above the address – Avesh Naik Apr 29 at 5:22
  • Doesn't worked for me. – Avesh Naik Apr 29 at 6:35
1

There is property name "isPasswordVisible" in the js file MAGENTO-ROOT/vendor/magento/module-checkout/view/frontend/web/js/view/form/element/email.js. You may try to override email.js class and set isPasswordVisible = true as describe below to always show the password field in the checkout page.

I assume you are using a custom theme name "Company_mytheme"

step 1)

Create requirejs-config.js under MAGENTO-ROOT/app/design/frontend/Company/mytheme/Magento_Checkout

File: MAGENTO-ROOT/app/design/frontend/Company/mytheme/Magento_Checkout/requirejs-config.js

var config = {
    config: {    
        mixins: {            
            'Magento_Checkout/js/view/form/element/email': {'Magento_Checkout/js/view/form/element/email-mixin': true},
        },                
    }         
};

step 2:

Create the mixin js file email-mixin.js MAGENTO-ROOT/app/design/frontend/Company/mytheme/Magento_Checkout/web/js/view/form/element/

File: MAGENTO-ROOT/app/design/frontend/Company/mytheme/Magento_Checkout/web/js/view/form/element/email-mixin.js

/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
define([
    'jquery',
], function ($) {
    'use strict';

    return function (Component) {
        return Component.extend({
            /**
             * @override
             */                          
             initConfig: function () {
                this._super();
                this.isPasswordVisible = true;                          
                return this;
            }  
        });
    }
});

Step 3: Refresh Magento cache

sudo php bin/magento c:f

enter image description here

  • Thank you. Your solution worked. – Avesh Naik Apr 29 at 9:14
  • It’s my pleasure. – Pritam Info 24 Apr 29 at 13:06

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