0

I was trying to overide checkout-agreements.html template via app/code and i created

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

var config = {
    map: {
        '*': {
          'Magento_CheckoutAgreements/template/checkout/checkout-agreements.html': 
          'Nami_CheckoutAgreements/template/checkout/checkout-agreements.html'
        }
    }
  };
  

Next i created

Vendor/Module/view/frontend/web/template/checkout/checkout-agreements.html

It's almost working becasue template is override but console show this error enter image description here

And when i try place order, console showing me this error and order is not completed.

enter image description here

Any ideas? I was trying overdie this checkout-agreements.html via app/design/frontend/Vendor/MyTheme/Magento_CheckoutAgreements/web/template/checkout/checkout-agreements.html

But it's not working and now i dont have any ideas. Please help

0

I don't think requirejs is where you overwrite template html file.

There an answer already on stackexchange, you can check it here How to override html file in magento 2.1

Another way to do this is you can write your own JS-module which extends from original module - the module that render/use that html template file.

From your own module, use your own template. Then use requirejs config to change the core module to your module.

7
  • When I overide template via app/design/frontend/Vendor/MyTheme/Magento_CheckoutAgreements/web/template/checkout/checkout-agreements.html it's working but console returns error with duplicate input, and place order not completed. How should I create reqiresjs-config-js to solve this problem? Where should i place reqiresjs-config-js file? Please help – Mateusz Mar 17 at 9:39
  • didn't you read the link I sent? – Jimmy Mar 17 at 9:45
  • Yes and override is working but i can't place order on my checkout page because console returns error like above – Mateusz Mar 17 at 9:50
  • but the link doesn't mention require or js anywhere? so I don't understand what are you trying to say here? – Jimmy Mar 17 at 9:55
  • Yes, and i override template via app/design/frontend/Vendor/MyTheme/Magento_CheckoutAgreements/web/template/checkout/checkout-agreements.html I created only this path, and it's workin but error with duplicates still remains. I delete my custom module and I do not use the requiresjq-config anywhere – Mateusz Mar 17 at 10:06

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.