Skip to content

Fixed Magento is no refreshing the cart page if you delete a product from cart side block #22478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
<see selector="{{StoreFrontRemoveItemModalSection.message}}" userInput="Are you sure you would like to remove this item from the shopping cart?" stepKey="seeDeleteConfirmationMessage"/>
<click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/>
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
<click selector="{{CheckoutCartProductSection.RemoveItem}}" stepKey="deleteProductFromCheckoutCart"/>
<dontSeeElement selector="{{CheckoutCartProductSection.RemoveItem}}" stepKey="dontSeeDeleteProductFromCheckoutCart"/>
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/>
<waitForPageLoad stepKey="WaitForPageLoad3"/>
<see userInput="You have no items in your shopping cart." stepKey="seeNoItemsInShoppingCart"/>
</test>
Expand Down
4 changes: 4 additions & 0 deletions app/code/Magento/Checkout/view/frontend/web/js/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ define([
$(document).trigger('ajax:removeFromCart', {
productIds: [productData['product_id']]
});

if (window.location.href.indexOf(this.shoppingCartUrl) === 0) {
window.location.reload();
}
}
},

Expand Down