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


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

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


Then create a folder:


This file will be catched during static-content deployment


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.