Skip to main content
Post Closed as "Duplicate" by KAndy, Raphael at Digital Pianism, Qaisar Satti, Anna Völkl, Marius
added 219 characters in body
Source Link
Sohel Rana
  • 36.1k
  • 3
  • 73
  • 91

In checkout, shipping.js file includeincluded 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 ?

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


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

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

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 ?

Source Link
Sohel Rana
  • 36.1k
  • 3
  • 73
  • 91

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

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


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

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