Skip to content

Commit

Permalink
Merge pull request #94 from foomo/v0.14.1
Browse files Browse the repository at this point in the history
fix(emarsys): always send cart
  • Loading branch information
franklinkim authored Feb 28, 2025
2 parents 837b8ae + 10a5197 commit 98399f9
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pkg/provider/emarsys/server/template/emarsyswebextendtagdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,22 +153,25 @@ function mapEventData() {
break;
}
case 'view_item': {
mappedData.cart = serializeItems(eventData.items || []);
mappedData.view = serializeItem(eventData.items[0] || {}, false);
break;
}
case 'view_item_list': {
mappedData.cart = serializeItems(eventData.items || []);
mappedData.category = eventData.item_list_id;
break;
}
case 'purchase': {
mappedData.cart = [];
mappedData.orderId = eventData.transaction_id;
mappedData.order = serializeItems(eventData.items || []);
if (eventData.tax) {
mappedData.order[0].price += eventData.tax;
}
if (eventData.shipping) {
mappedData.order[0].price += eventData.shipping;
}
if (eventData.tax) {
mappedData.order[0].price += eventData.tax;
}
if (eventData.shipping) {
mappedData.order[0].price += eventData.shipping;
}
break;
}
}
Expand Down

0 comments on commit 98399f9

Please sign in to comment.