diff --git a/CHANGELOG.md b/CHANGELOG.md index ac0ae83..4388dd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed +- Fix `item_category` hierarchy on event `purchase` + ## [3.5.1] - 2023-05-10 ### Fixed - Fix attributes received from `eventData` on event `vtex:addToWishlist` extracting `items.product` ans using `sku` instead `selectedSku` diff --git a/react/modules/utils.ts b/react/modules/utils.ts index 45f0598..43abf1e 100644 --- a/react/modules/utils.ts +++ b/react/modules/utils.ts @@ -205,7 +205,7 @@ function formatPurchaseProduct(product: ProductOrder) { sku, price, quantity, - category, + categoryTree, productRefId, skuRefId, } = product @@ -219,7 +219,7 @@ function formatPurchaseProduct(product: ProductOrder) { item_variant: sku, price, quantity, - ...getCategoriesWithHierarchy([category]), + ...getCategoriesWithHierarchy([categoryTree.join('/')]), ...customDimensions({ productReference: productRefId, skuReference: skuRefId,