Skip to content

Commit

Permalink
fix: wishlist add all results popup (#1584)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-kalachikov authored Feb 18, 2025
1 parent 6bb6333 commit 3957c8a
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions client-app/pages/account/list-details.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,19 @@ async function addAllListItemsToCart(): Promise<void> {
const items = wishlistItems.value.map(({ productId, quantity }) => ({ productId, quantity }));
await addItemsToCart(items);
const products = wishlistItems.value.map((item) => item.product!);
analytics("addItemsToCart", products);
void pushHistoricalEvent({
eventType: "addToCart",
sessionId: cart.value?.id,
productIds: products.map((product) => product.id),
storeId: globals.storeId,
});
const products = wishlistItems.value
.map((item) => item.product)
.filter((product): product is NonNullable<typeof product> => !!product);
if (products.length) {
analytics("addItemsToCart", products);
void pushHistoricalEvent({
eventType: "addToCart",
sessionId: cart.value?.id,
productIds: products.map((product) => product.id),
storeId: globals.storeId,
});
}
showResultModal(wishlistItems.value);
}
Expand Down

0 comments on commit 3957c8a

Please sign in to comment.