Skip to content

How to Override HTML Template from Module in Magento 2

Today, we will guide you on how to override Html template from your custom module (not from your custom theme) in Magento 2.

vendor\magento\module-checkout\view\frontend\web\template\shipping.html

first, create a module, for example, a module Dev_Testing

  1. copy custom file shipping.phtml to Dev\Testing\view\frontend\web\template
  2. create file requirejs-config.js, put in Dev\Testing\view\frontend

Now Run the cache flush command.

php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
(use -f for force deploy on 2.2.x or later)

You need to run a command using SSh from the root of your Magento instance. If you want to more command list then refer our another post which Magento 2 useful commands lists.


Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Share via
Copy link
Powered by Social Snap