3

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?

  • Did you get the solution for your question, if ok please send the answer – shivashankar m Sep 8 '17 at 12:28
1

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

vendor/module-ui/view/base/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"
  }
}
  • Where i have to keep this code, Please let me know the file location – shivashankar m Sep 8 '17 at 12:25
  • In the main root of your theme: <Vendor>/<Theme>/requirejs-config.js – nuovecode Sep 11 '17 at 8:50
  • "Magento_Ui/js/modal/confirm": "Vendor_Module/js/your-js-module" – shivashankar m Sep 19 '17 at 4:31
  • what is this "your-js-module" – shivashankar m Sep 19 '17 at 4:32
  • which module i have to give here – shivashankar m Sep 19 '17 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.