@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.
package/dist/index.mjs CHANGED
@@ -861,7 +861,7 @@ var trackAddToCartGA = ({
861
861
  return;
862
862
  }
863
863
  const currencyCode = lineItems[0].product?.price?.currencyCode;
864
- const totalPrice = lineItems.reduce((prev, item) => prev.plus(item.totalAmount || 0), new Decimal3(0)).toNumber();
864
+ const totalPrice = lineItems.reduce((prev, item) => prev.plus(item.finalPrice?.amount || item.totalAmount || 0), new Decimal3(0)).toNumber();
865
865
  gaTrack({
866
866
  event: "ga4Event",
867
867
  event_name: "add_to_cart",
@@ -2547,6 +2547,7 @@ function useAddToCart({ withTrack = true } = {}, swrOptions) {
2547
2547
  }
2548
2548
  return {
2549
2549
  ...cartLine,
2550
+ finalPrice: inputLine.variant?.finalPrice,
2550
2551
  quantity: inputLine.quantity,
2551
2552
  gtmParams: inputLine.gtmParams
2552
2553
  };