@lookiero/checkout 4.0.1-beta.0 → 4.0.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,15 +40,15 @@ const CheckoutPaymentModal = ({ customerId, country, coupon, isFirstOrder, subsc
40
40
  const handleOnSubmitCheckoutError = useCallback(() => navigate(`${basePath}/${Routes.CHECKOUT}`, { replace: true }), [basePath, navigate]);
41
41
  const handleOnSubmitCheckoutSuccess = useCallback(() => {
42
42
  const checkoutItemsKept = checkout?.items.filter((checkoutItem) => checkoutItem.status === CheckoutItemStatus.KEPT || checkoutItem.status === CheckoutItemStatus.REPLACED);
43
- const sizeChange = checkoutItemsKept?.filter(({ replacedFor }) => Boolean(replacedFor)).length || 0;
43
+ const totalReplacedFor = checkoutItemsKept?.filter(({ replacedFor }) => Boolean(replacedFor)).length || 0;
44
44
  trackCheckout({
45
- items: checkoutItemsKept?.length || 0,
46
- value: pricing?.pendingToPay.amount / 100,
45
+ totalCheckoutItemsKept: checkoutItemsKept?.length || 0,
46
+ pendingToPay: pricing?.pendingToPay.amount / 100,
47
47
  coupon,
48
48
  currencyCode: pricing?.pendingToPay.currency,
49
49
  isFirstOrder,
50
50
  orderNumber,
51
- sizeChange,
51
+ totalReplacedFor,
52
52
  subscription,
53
53
  userId: customerId,
54
54
  });
@@ -4,14 +4,14 @@ import { Country } from "../../../projection/shared/country";
4
4
  import { Subscription } from "../../../projection/shared/subscription";
5
5
  interface TrackCheckoutFunctionArgs {
6
6
  readonly userId: string;
7
- readonly sizeChange: number;
7
+ readonly totalReplacedFor: number;
8
8
  readonly isFirstOrder: boolean;
9
- readonly items: number;
9
+ readonly totalCheckoutItemsKept: number;
10
10
  readonly currencyCode: Currency;
11
11
  readonly subscription: Subscription;
12
12
  readonly coupon: string | null;
13
13
  readonly orderNumber: number;
14
- readonly value: number;
14
+ readonly pendingToPay: number;
15
15
  }
16
16
  interface TrackCheckoutFunction {
17
17
  (args: TrackCheckoutFunctionArgs): void;
@@ -4,7 +4,7 @@ import { TrackingEvent, TrackingEventCategory } from "../tracking";
4
4
  import { useEmitUserEvent } from "./useEmitUserEvent";
5
5
  const useTrackCheckout = ({ page, country, checkoutId }) => {
6
6
  const emitUserEvent = useEmitUserEvent();
7
- const trackCheckout = useCallback(({ coupon, currencyCode, isFirstOrder, items, orderNumber, sizeChange, subscription, userId, value }) => {
7
+ const trackCheckout = useCallback(({ coupon, currencyCode, isFirstOrder, orderNumber, pendingToPay, subscription, totalCheckoutItemsKept, totalReplacedFor, userId, }) => {
8
8
  if (!checkoutId) {
9
9
  return;
10
10
  }
@@ -15,16 +15,16 @@ const useTrackCheckout = ({ page, country, checkoutId }) => {
15
15
  store: country,
16
16
  checkoutId,
17
17
  userId,
18
- sizeChange,
18
+ sizeChange: totalReplacedFor,
19
19
  isFirstOrder,
20
20
  ecommerce: {
21
21
  actionField: {
22
- items,
22
+ items: totalCheckoutItemsKept,
23
23
  currencyCode,
24
24
  subscription,
25
25
  coupon,
26
- orderNumber,
27
- value,
26
+ orderId: orderNumber,
27
+ value: pendingToPay,
28
28
  },
29
29
  },
30
30
  };
@@ -96,7 +96,7 @@ interface CheckoutTrackingEvent extends BaseTrackingEvent {
96
96
  readonly currencyCode: Currency;
97
97
  readonly subscription: Subscription;
98
98
  readonly coupon: string | null;
99
- readonly orderNumber: number;
99
+ readonly orderId: number;
100
100
  readonly value: number;
101
101
  };
102
102
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "4.0.1-beta.0",
3
+ "version": "4.0.1-beta.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [