cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 : Replace a custom JS component

Magento 2 : Replace a custom JS component

We are working on a module that requires JS overwrite for file “Magento_Checkout/js/model/shipping-save-processor/default”.

 

  • We are able to overwrite the JS using the steps provided in the magento guide.
  • However this JS is already overwritten by AvaTax module.
  • So instead of overwriting the default Magento JS we are trying to overwrite the Avatax JS using the same steps.
  • We have added dependency in our module so that the Avatax module is loaded first.
  • But this JS overwrite is successful only, if we overwrite the default Magento JS.

 

We don’t want to make changes directly in the Avatax JS.

 

Is there any other way out?

1 REPLY 1

Re: Magento 2 : Replace a custom JS component

After trying the different possibilities, we think mapping works only for default JS files, and not for custom JS files.

To overwrite the JS we moved it to theme folder instead of overwriting it from Module.

The theme overwrite is working as expected.

Theme overwrite for `shipping-save-processor/default.js` is done as follows:

app/design/frontend/xxx/yyy/XYZ_AvaTax/web/js/model/shipping-save-processor/default.js