Skip to content

Commit

Permalink
feat: add ads data-attributes to ProductCard to be tracked by Activit…
Browse files Browse the repository at this point in the history
…y Flow
  • Loading branch information
fltiago committed Sep 17, 2024
1 parent 1774e08 commit 3cfabb0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/core/src/components/product/ProductCard/ProductCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function ProductCard({
sku,
isVariantOf: { name },
image: [img],
advertisement,
offers: {
lowPrice,
lowPriceWithTaxes,
Expand Down Expand Up @@ -105,13 +106,15 @@ function ProductCard({
: listPriceBase

const hasDiscount = spotPrice <= listPrice

return (
<UIProductCard
outOfStock={outOfStock}
bordered={bordered}
variant={variant}
data-fs-product-card-sku={sku}
data-van-res-id={advertisement?.adResponseId ?? ''}
data-van-aid={advertisement?.adId ?? ''}
data-van-prod-name={advertisement ? name : ''}
{...otherProps}
>
<UIProductCardImage aspectRatio={aspectRatio}>
Expand Down Expand Up @@ -189,6 +192,14 @@ export const fragment = gql(`
value
valueReference
}
advertisement {
adId
campaignId
actionCost
adRequestId
adResponseId
}
}
`)

Expand Down

0 comments on commit 3cfabb0

Please sign in to comment.