Skip to content

Commit a14c101

Browse files
authored
ENGCOM-5649: Fixed Magento is no refreshing the cart page if you delete a product from cart side block #22478
2 parents df5dfc3 + 8cdeb0e commit a14c101

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/code/Magento/Checkout/Test/Mftf/Test/NoErrorCartCheckoutForProductsDeletedFromMiniCartTest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
<see selector="{{StoreFrontRemoveItemModalSection.message}}" userInput="Are you sure you would like to remove this item from the shopping cart?" stepKey="seeDeleteConfirmationMessage"/>
4848
<click selector="{{StoreFrontRemoveItemModalSection.ok}}" stepKey="confirmDelete"/>
4949
<waitForPageLoad stepKey="waitForDeleteToFinish"/>
50-
<click selector="{{CheckoutCartProductSection.RemoveItem}}" stepKey="deleteProductFromCheckoutCart"/>
50+
<dontSeeElement selector="{{CheckoutCartProductSection.RemoveItem}}" stepKey="dontSeeDeleteProductFromCheckoutCart"/>
51+
<click selector="{{StorefrontMinicartSection.showCart}}" stepKey="clickCart"/>
5152
<waitForPageLoad stepKey="WaitForPageLoad3"/>
5253
<see userInput="You have no items in your shopping cart." stepKey="seeNoItemsInShoppingCart"/>
5354
</test>

app/code/Magento/Checkout/view/frontend/web/js/sidebar.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,10 @@ define([
261261
$(document).trigger('ajax:removeFromCart', {
262262
productIds: [productData['product_id']]
263263
});
264+
265+
if (window.location.href.indexOf(this.shoppingCartUrl) === 0) {
266+
window.location.reload();
267+
}
264268
}
265269
},
266270

0 commit comments

Comments
 (0)