0

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.

2

1 Answer 1

0

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
            });
        }
    }
})

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.