2

I am attempting to override this file

\vendor\magento\module-checkout\view\frontend\web\js\view\form\element\email.js


First I create a requirejs-config.js file in

C:\wamp64\www\magento222\app\code\BodyMod\EmailHide\view\frontend\

with the following content

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


Second I create an email-mixin.js file in

C:\wamp64\www\magento222\app\code\BodyMod\EmailHide\view\frontend\web\js\


But it is not working. What am I doing wrong?

0

app/code/Vendor/Module/view/frontend/requirejs-config.js:

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

app/code/Vendor/Module/view/frontend/web/js/mixin/email-mixin.js:

define([
    'jquery'
], function ($) {
    'use strict';
    return function (Email) {
        return Email.extend({
            checkEmailAvailability: function () {
                console.log('test');
                return this._super();
            }
        });
    }
});

after this remember to regenerate static content :)

| improve this answer | |

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.