code updated

This commit is contained in:
rahulshukla-home 2020-08-10 18:17:39 +05:30
parent 5663afec6a
commit 84ba38ca2a
1 changed files with 12 additions and 6 deletions

View File

@ -209,18 +209,24 @@
if (productId == "all") {
updatedItems = [];
this.$set(this, 'products', []);
window.showAlert(
`alert-success`,
this.__('shop.general.alert.success'),
`${this.__('customer.compare.removed-all')}`
);
} else {
updatedItems = existingItems.filter(item => item != productId);
this.$set(this, 'products', this.products.filter(product => product.id != productId));
window.showAlert(
`alert-success`,
this.__('shop.general.alert.success'),
`${this.__('customer.compare.removed')}`
);
}
this.setStorageValue('compared_product', updatedItems);
window.showAlert(
`alert-success`,
this.__('shop.general.alert.success'),
`${this.__('customer.compare.removed')}`
);
}
this.$root.headerItemsCount++;