Magento 2 – Mini Cart Item Delete Alert

alertdeletemagento2mini-cart

Can anyone let me know, How an alert box getting delete an item popup, from minicart:
location below:

line 71:

vendor/magento/module-checkout/view/frontend/web/js/view/minicart.js

Where defined the alert for this, Please let me know the location of alert. in magento2.

Best Answer

I you are still looking for an answer, the modal confirmation is created in vendor/magento/module-checkout/view/frontend/web/js/sidebar.js and it's a parameter named confirm:

        /**
         * @param {jQuery.Event} event
         */
        events['click ' + this.options.button.remove] =  function (event) {
            event.stopPropagation();
            confirm({
                content: self.options.confirmMessage,
                actions: {
                    /** @inheritdoc */
                    confirm: function () {
                        self._removeItem($(event.currentTarget));
                    },

                    /** @inheritdoc */
                    always: function (e) {
                        e.stopImmediatePropagation();
                    }
                }
            });
        };
Related Topic