0

I'm trying to overwrite below html template file but not working. I have already run commands.

vendor\magento\module-sales-rule\view\frontend\web\template\payment\discount.html

to

app\design\frontend\Pt\name\Magento_SalesRules\web\template\payment\discount.html

1

You can try the below method to override .html files:

Create a requirejs-config.js file from below path.

app/code/Vendor/Module/view/frontend/requirejs-config.js

And place below code in requirejs-config.js

var config = {
    map: {
        '*': {
          'Magento_SalesRule/template/payment/discount.html' : 'Vendor_Module/template/payment/discount.html'
        }
  }
};

Path of new discount.html will be like below:

app/code/Vendor/Module/view/frontend/web/template/payment/discount.html

So we can override any html file in this way.

4

Just create or edit requirejs-config.js file from below path.

app/code/Namespace/Module/view/frontend/requirejs-config.js

And place below code in requirejs-config.js

var config = {
    map: {
        '*': {
          'Magento_Payment/template/payment/cc-form.html': 
              'Namespace_Module/template/payment/cc-form.html'
        }
  }
};

So we can override any html file in this way.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.