2

How can I override Magento 2 core js based on system configuration (Yes/No)? For example Currently I am overriding checkout default js into my module. And it works fine for me. Now I want to override this based on my system configuration setting. Is there any way to achieve this ?

var config = {
    "map": {
        "*": {
            "Magento_Checkout/js/model/shipping-save-processor/default" : "VENDOR_MODULENAME/js/shipping-save-processor-default-override"
        }
    }
};
1

just put all overriding code into if condition.

if(your condition)
{
    var config = {
    "map": {
        "*": {
            "Magento_Checkout/js/model/shipping-save-processor/default" : "VENDOR_MODULENAME/js/shipping-save-processor-default-override"
        }
     }
   };
}

Overriding will work if your condition will true.

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.