5

AFAIK, the mage.confirm widget is defined in this file:

vendor/magento/module-ui/view/base/web/js/modal/confirm.js

I'm looking to override the file in my theme to provide alternative default behaviour for confirm modals (e.g. the one displayed in M2 when removing an item from the minicart).

I've tried to customise the widget following the steps in the FE dev docs without success. Is it possible to override this base file?

1
  • Did you get the solution for your question, if ok please send the answer Sep 8, 2017 at 12:28

2 Answers 2

2

You could locate this file in you theme. As your original file is in:

vendor/magento/module-ui/view/base/web/js/modal/confirm.js

Then create a folder:

app/design/[vendor]/[theme]/Magento_Ui/web/js/modal/confirm.js

This file will be catched during static-content deployment

0

try with:

map: {
  '*': {
    "Magento_Ui/js/modal/confirm":  "Vendor_Module/js/your-js-module"
  }
}
9
  • Where i have to keep this code, Please let me know the file location Sep 8, 2017 at 12:25
  • In the main root of your theme: <Vendor>/<Theme>/requirejs-config.js
    – nuovecode
    Sep 11, 2017 at 8:50
  • "Magento_Ui/js/modal/confirm": "Vendor_Module/js/your-js-module" Sep 19, 2017 at 4:31
  • what is this "your-js-module" Sep 19, 2017 at 4:32
  • which module i have to give here Sep 19, 2017 at 4:32

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.