Magento 2.x – Override HTML files


If you need to override a HTML file, ie, used on a uiComponent, you have a couple of ways to sort it, in this tutorial i will show you how to do it for the summary.html of the checkout.

  • Override summary.html within a module:

/app/code/<vendor>/<module>/view/frontend/web/requirejs-config.js

/app/code/<vendor>/<module>/view/frontend/web/template/summary.html

  • Override the file, directly on your custom theme (this will have priority over modules), in here:

app/design/frontend/<vendor>/<theme_name>/Magento_Checkout/web/template/summary.html

 

After adding whichever piece of code, you will need to run following commands:

 

And that’s it. Give a try, and you should see something like this on your checkout order summary:

Happy coding.