Is there any way to reload the page completely, when we remove an item from mini cart. https://prnt.sc/11i1x2g After clicking on ok , i want to reload the page.
1 Answer
You need to override _ajax function of
vendor/magento/module-checkout/view/frontend/web/js/sidebar.js
in your custom theme and add code to reload page after removing item from minicart as below
.done(function (response) { var msg; if (response.success) { callback.call(this, elem, response); window.location.reload(true);// CODE ADDED TO RELOAD PAGE AFTER REMOVING ITEM FROM MINICART SUCCESSFULLY } else { msg = response['error_message']; if (msg) { alert({ content: msg }); } } })