Jump to content


Photo

How to Override JS File in Magento 2


  • Please log in to reply
No replies to this topic

#1 Meetanshi

Meetanshi

    Advanced Member

  • Members
  • PipPipPip
  • 535 posts

Posted 13 December 2019 - 07:59 AM

It is strongly recommended not to change the source code of default Magento components including JS files. However, owing to the business requirements you are bound to go out of the way and override js file in magento 2 the default function.
 
Here, I have posted the code to override JS file in Magento 2. You may use this code when you want to extend the default JS file to extend a default Magento 2 feature at https://meetanshi.com/blog/override-js-file-in-magento-2/
 


looking for the best presta addons with outstanding support? check this: PrestaShop Modules