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

3 Answers 3

3

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.

6

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.

0

Maybe it's just a typo

Try rename this:

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

With this

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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