Skip to content

Commit

Permalink
feat: add delivery_category as part of contents
Browse files Browse the repository at this point in the history
  • Loading branch information
sandeepdsvs committed Nov 10, 2023
1 parent ab34c18 commit 6425f5b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/v0/destinations/facebook_pixel/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ const handleOrder = (message, categoryToContent) => {
const contentType = getContentType(message, 'product', categoryToContent);
const contentIds = [];
const contents = [];
const { category, quantity, price, currency, contentName } = message.properties;
const {
category,
quantity,
price,
currency,
contentName,
delivery_category: deliveryCategory,
} = message.properties;
if (products) {
if (products.length > 0 && Array.isArray(products)) {
products.forEach((singleProduct) => {
Expand All @@ -72,6 +79,7 @@ const handleOrder = (message, categoryToContent) => {
id: pId,
quantity: singleProduct.quantity || quantity || 1,
item_price: singleProduct.price || price,
delivery_category: singleProduct.delivery_category || deliveryCategory,
};
contents.push(content);
}
Expand Down

0 comments on commit 6425f5b

Please sign in to comment.