mirror of
https://github.com/foomo/sesamy-cli.git
synced 2025-10-16 12:35:36 +00:00
fix(emarsys): always send cart
This commit is contained in:
parent
837b8ae069
commit
10a5197998
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user