@anker-in/shopify-react 1.2.2-beta.7 → 1.2.2-beta.8

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.
@@ -772,7 +772,7 @@ var trackAddToCartGA = ({
772
772
  return;
773
773
  }
774
774
  const currencyCode = lineItems[0].product?.price?.currencyCode;
775
- const totalPrice = lineItems.reduce((prev, item) => prev.plus(item.totalAmount || 0), new Decimal3(0)).toNumber();
775
+ const totalPrice = lineItems.reduce((prev, item) => prev.plus(item.finalPrice?.amount || item.totalAmount || 0), new Decimal3(0)).toNumber();
776
776
  gaTrack({
777
777
  event: "ga4Event",
778
778
  event_name: "add_to_cart",
@@ -2377,6 +2377,7 @@ function useAddToCart({ withTrack = true } = {}, swrOptions) {
2377
2377
  }
2378
2378
  return {
2379
2379
  ...cartLine,
2380
+ finalPrice: inputLine.variant?.finalPrice,
2380
2381
  quantity: inputLine.quantity,
2381
2382
  gtmParams: inputLine.gtmParams
2382
2383
  };