Skip to content

Commit 30e6366

Browse files
committed
Refresh the cart page when the user modifies the minicart (#2990)
1 parent e8fc4d4 commit 30e6366

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

skin/frontend/rwd/default/js/minicart.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Minicart.prototype = {
9191
}).done(function(result) {
9292
cart.hideOverlay();
9393
if (result.success) {
94+
cart.refreshIfOnCartPage();
9495
cart.updateCartQty(result.qty);
9596
cart.updateContentOnRemove(result, el.closest('li'));
9697
} else {
@@ -155,6 +156,7 @@ Minicart.prototype = {
155156
}).done(function(result) {
156157
cart.hideOverlay();
157158
if (result.success) {
159+
cart.refreshIfOnCartPage();
158160
cart.updateCartQty(result.qty);
159161
if (quantity !== 0) {
160162
cart.updateContentOnUpdate(result);
@@ -176,7 +178,6 @@ Minicart.prototype = {
176178
el.hide('slow', function() {
177179
$j(cart.selectors.container).html(result.content);
178180
cart.showMessage(result);
179-
180181
});
181182
},
182183

@@ -224,5 +225,11 @@ Minicart.prototype = {
224225

225226
showSuccess: function(message) {
226227
$j(this.selectors.success).text(message).fadeIn('slow');
228+
},
229+
230+
refreshIfOnCartPage: function() {
231+
if (document.body.classList.contains("checkout-cart-index")){
232+
window.location.reload(true);
233+
}
227234
}
228235
};

0 commit comments

Comments
 (0)