@anker-in/shopify-react 0.1.1-beta.44 → 0.1.1-beta.45

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.
@@ -1255,7 +1255,7 @@ function getCartAttributes({
1255
1255
  },
1256
1256
  {
1257
1257
  key: "_member_type",
1258
- value: memberType ?? String(profile?.memberType || 0)
1258
+ value: memberType ?? String(profile?.memberType)
1259
1259
  },
1260
1260
  {
1261
1261
  key: "_user_type",
@@ -1379,51 +1379,6 @@ var useCartItemQuantityLimit = ({
1379
1379
  }, [cartItem, cart]);
1380
1380
  return quantityLimit;
1381
1381
  };
1382
- function hasPlusMemberInLines({
1383
- memberSetting,
1384
- lines
1385
- }) {
1386
- const { plus_monthly_product, plus_annual_product } = memberSetting || {};
1387
- if (!lines || lines.length === 0) {
1388
- return {
1389
- hasPlusMember: false,
1390
- hasMonthlyPlus: false,
1391
- hasAnnualPlus: false
1392
- };
1393
- }
1394
- const monthlyPlusLine = lines.find((line) => {
1395
- const variantHandle = line.variant?.product?.handle;
1396
- const variantSku = line.variant?.sku;
1397
- return variantHandle === plus_monthly_product?.handle && variantSku === plus_monthly_product?.sku;
1398
- });
1399
- const annualPlusLine = lines.find((line) => {
1400
- const variantHandle = line.variant?.product?.handle;
1401
- const variantSku = line.variant?.sku;
1402
- return variantHandle === plus_annual_product?.handle && variantSku === plus_annual_product?.sku;
1403
- });
1404
- const hasMonthlyPlus = !!monthlyPlusLine;
1405
- const hasAnnualPlus = !!annualPlusLine;
1406
- const hasPlusMember = hasMonthlyPlus || hasAnnualPlus;
1407
- return {
1408
- hasPlusMember,
1409
- hasMonthlyPlus,
1410
- hasAnnualPlus,
1411
- monthlyPlusLine,
1412
- annualPlusLine
1413
- };
1414
- }
1415
- function useHasPlusMemberInLines({
1416
- memberSetting,
1417
- lines
1418
- }) {
1419
- return useMemo(
1420
- () => hasPlusMemberInLines({
1421
- memberSetting,
1422
- lines
1423
- }),
1424
- [memberSetting, lines]
1425
- );
1426
- }
1427
1382
  var useUpdateLineCodeAmountAttributes = ({
1428
1383
  cart,
1429
1384
  mutateCart,
@@ -1981,6 +1936,51 @@ function useHasPlusMemberInCart({
1981
1936
  [memberSetting, cart]
1982
1937
  );
1983
1938
  }
1939
+ function hasPlusMemberInLines({
1940
+ memberSetting,
1941
+ lines
1942
+ }) {
1943
+ const { plus_monthly_product, plus_annual_product } = memberSetting || {};
1944
+ if (!lines || lines.length === 0) {
1945
+ return {
1946
+ hasPlusMember: false,
1947
+ hasMonthlyPlus: false,
1948
+ hasAnnualPlus: false
1949
+ };
1950
+ }
1951
+ const monthlyPlusLine = lines.find((line) => {
1952
+ const variantHandle = line.variant?.product?.handle;
1953
+ const variantSku = line.variant?.sku;
1954
+ return variantHandle === plus_monthly_product?.handle && variantSku === plus_monthly_product?.sku;
1955
+ });
1956
+ const annualPlusLine = lines.find((line) => {
1957
+ const variantHandle = line.variant?.product?.handle;
1958
+ const variantSku = line.variant?.sku;
1959
+ return variantHandle === plus_annual_product?.handle && variantSku === plus_annual_product?.sku;
1960
+ });
1961
+ const hasMonthlyPlus = !!monthlyPlusLine;
1962
+ const hasAnnualPlus = !!annualPlusLine;
1963
+ const hasPlusMember = hasMonthlyPlus || hasAnnualPlus;
1964
+ return {
1965
+ hasPlusMember,
1966
+ hasMonthlyPlus,
1967
+ hasAnnualPlus,
1968
+ monthlyPlusLine,
1969
+ annualPlusLine
1970
+ };
1971
+ }
1972
+ function useHasPlusMemberInLines({
1973
+ memberSetting,
1974
+ lines
1975
+ }) {
1976
+ return useMemo(
1977
+ () => hasPlusMemberInLines({
1978
+ memberSetting,
1979
+ lines
1980
+ }),
1981
+ [memberSetting, lines]
1982
+ );
1983
+ }
1984
1984
  function usePlusMemberNeedAddToCart({
1985
1985
  cart,
1986
1986
  profile
@@ -2244,11 +2244,12 @@ function useBuyNow({ withTrack = true } = {}, swrOptions) {
2244
2244
  if (!lineItems || lineItems.length === 0) {
2245
2245
  return;
2246
2246
  }
2247
- const { hasPlusMember } = useHasPlusMemberInLines({
2247
+ const { hasPlusMember } = hasPlusMemberInLines({
2248
2248
  memberSetting,
2249
2249
  lines: lineItems
2250
2250
  });
2251
2251
  const memberType = hasPlusMember ? "2" : String(profile?.memberType ?? 0);
2252
+ console.log("customer", customer);
2252
2253
  const cartAttributes = getCartAttributes({
2253
2254
  profile,
2254
2255
  customer,