Skip to content

Commit 36b7271

Browse files
Chhandak.BaruaChhandak.Barua
authored andcommitted
ACP2E-1007 Compare list redirect to old store
1 parent 9adbb92 commit 36b7271

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/code/Magento/Catalog/view/frontend/web/js/view/compare-products.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ define([
3131
initialize: function () {
3232
this._super();
3333
this.compareProducts = customerData.get('compare-products');
34+
if (window.checkout &&
35+
window.checkout.websiteId &&
36+
window.checkout.websiteId !== this.compareProducts().websiteId
37+
// TODO this code is only needed if websites share same domain (store code in url)
38+
) {
39+
//set count to 0 to prevent "compared products" blocks and count to show with wrong count and items
40+
this.compareProducts().count = 0;
41+
customerData.reload(['compare-products'], false);
42+
}
3443
initSidebar();
3544
}
3645
});

0 commit comments

Comments
 (0)