Skip to content

Commit

Permalink
feat: add support for discount code on Klaviyo's order placed event
Browse files Browse the repository at this point in the history
  • Loading branch information
nicohps committed Dec 3, 2024
1 parent e2dbdc7 commit 2e17860
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export interface KlaviyoOrderPlacedEvent extends KlaviyoGenericEvent {
*/
totalOrderValue: number;
orderItems: KlaviyoOrderItem[];
discountCode?: string;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ export function mapToKlaviyoOrderPlacedInput(
RowTotal: item.RowTotal,
})),
};
if (event.discountCode) {
orderProperties.DiscountCode = event.discountCode;
}
if (event.customProperties) {
orderProperties.CustomProperties = event.customProperties;
}
Expand Down

0 comments on commit 2e17860

Please sign in to comment.