Skip to main content
2 of 2
added 219 characters in body
Sohel Rana
  • 36.1k
  • 3
  • 73
  • 91

Magento2: What is the best way to overwrite shipping.js in checkout

In checkout, shipping.js file included by xml. that means inside checkout_index_index.xml.

<item name="component" xsi:type="string">Magento_Checkout/js/view/shipping</item>

So my need: add some functionality to initialize method without changing in main method.

something like :


initialize: function () {
    //call main method
    // custom functionality
},

What is the best way to modify some code of shipping.js ?

Sohel Rana
  • 36.1k
  • 3
  • 73
  • 91