Skip to content

Commit f5a2d45

Browse files
committed
Add custom fields for transformProducts and action for Checkout
1 parent c5efe7b commit f5a2d45

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/enhanced-ecommerce-sylius/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "lin3s-react-analytics-enhanced-ecommerce-sylius",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"author": "LIN3S",
55
"license": "MIT",
66
"description": "Transformations to turn Sylius objects into Enhanced Eccomerce Data Layers",

packages/enhanced-ecommerce-sylius/src/transforms.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const transformProducts = (items, params) => items.map(item => ({
2323
brand: item.brand || params.brand,
2424
category: getCategoryForProduct(item.product),
2525
quantity: item.quantity,
26+
...item.customFields,
2627
}));
2728

2829
const transformProductsForImpression = (products, params) => products.map((product, index) => ({
@@ -103,6 +104,7 @@ const transformCartItemsForCheckoutDL = (cartItems, params = {}) => ({
103104
checkout: {
104105
actionField: {
105106
step: params.step || 1,
107+
...params.customActionField,
106108
},
107109
products: transformProducts(cartItems, params),
108110
}

0 commit comments

Comments
 (0)