@anker-in/shopify-react 0.1.1-beta.42 → 0.1.1-beta.43
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/hooks/index.d.mts +57 -150
- package/dist/hooks/index.d.ts +57 -150
- package/dist/hooks/index.js +63 -246
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +64 -245
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +63 -246
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -245
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +1 -1
- package/dist/provider/index.d.ts +1 -1
- package/dist/provider/index.js +35 -46
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +35 -46
- package/dist/provider/index.mjs.map +1 -1
- package/dist/{types-DntkHhf8.d.mts → types-CMMWxyUF.d.mts} +2 -6
- package/dist/{types-DntkHhf8.d.ts → types-CMMWxyUF.d.ts} +2 -6
- package/package.json +5 -5
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createContext, useMemo, useRef, useState, useEffect, useCallback, useContext } from 'react';
|
|
2
2
|
import useSWRMutation from 'swr/mutation';
|
|
3
|
-
import { getProductsByHandles, createCart, updateCartCodes, addCartLines, updateCartLines, removeCartLines, updateCartAttributes, getLocalStorage, getProduct, getAllProducts, getCollection, getAllCollections, getCollections, getBlog, getAllBlogs, getArticle, getArticles, getArticlesInBlog, setLocalStorage
|
|
3
|
+
import { getProductsByHandles, createCart, updateCartCodes, addCartLines, updateCartLines, removeCartLines, updateCartAttributes, getLocalStorage, getProduct, getAllProducts, getCollection, getAllCollections, getCollections, getBlog, getAllBlogs, getArticle, getArticles, getArticlesInBlog, setLocalStorage } from '@anker-in/shopify-sdk';
|
|
4
4
|
import Cookies5 from 'js-cookie';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
6
6
|
import Decimal2 from 'decimal.js';
|
|
@@ -1451,36 +1451,46 @@ var useCalcOrderDiscount = (cart, orderDiscountConfig, customer) => {
|
|
|
1451
1451
|
isLoading: isCustomerLoading
|
|
1452
1452
|
};
|
|
1453
1453
|
};
|
|
1454
|
-
function
|
|
1454
|
+
function hasPlusMemberInCart({
|
|
1455
1455
|
memberSetting,
|
|
1456
1456
|
cart
|
|
1457
1457
|
}) {
|
|
1458
1458
|
const { plus_monthly_product, plus_annual_product } = memberSetting || {};
|
|
1459
|
-
|
|
1460
|
-
if (!cart?.lineItems) {
|
|
1461
|
-
return {
|
|
1462
|
-
hasPlusMember: false,
|
|
1463
|
-
hasMonthlyPlus: false,
|
|
1464
|
-
hasAnnualPlus: false
|
|
1465
|
-
};
|
|
1466
|
-
}
|
|
1467
|
-
const monthlyPlusItem = cart.lineItems.find(
|
|
1468
|
-
(item) => item.product?.handle === plus_monthly_product?.handle && item.variant?.sku === plus_monthly_product?.sku
|
|
1469
|
-
);
|
|
1470
|
-
const annualPlusItem = cart.lineItems.find(
|
|
1471
|
-
(item) => item.product?.handle === plus_annual_product?.handle && item.variant?.sku === plus_annual_product?.sku
|
|
1472
|
-
);
|
|
1473
|
-
const hasMonthlyPlus = !!monthlyPlusItem;
|
|
1474
|
-
const hasAnnualPlus = !!annualPlusItem;
|
|
1475
|
-
const hasPlusMember = hasMonthlyPlus || hasAnnualPlus;
|
|
1459
|
+
if (!cart?.lineItems) {
|
|
1476
1460
|
return {
|
|
1477
|
-
hasPlusMember,
|
|
1478
|
-
hasMonthlyPlus,
|
|
1479
|
-
hasAnnualPlus
|
|
1480
|
-
monthlyPlusItem,
|
|
1481
|
-
annualPlusItem
|
|
1461
|
+
hasPlusMember: false,
|
|
1462
|
+
hasMonthlyPlus: false,
|
|
1463
|
+
hasAnnualPlus: false
|
|
1482
1464
|
};
|
|
1483
|
-
}
|
|
1465
|
+
}
|
|
1466
|
+
const monthlyPlusItem = cart.lineItems.find(
|
|
1467
|
+
(item) => item.product?.handle === plus_monthly_product?.handle && item.variant?.sku === plus_monthly_product?.sku
|
|
1468
|
+
);
|
|
1469
|
+
const annualPlusItem = cart.lineItems.find(
|
|
1470
|
+
(item) => item.product?.handle === plus_annual_product?.handle && item.variant?.sku === plus_annual_product?.sku
|
|
1471
|
+
);
|
|
1472
|
+
const hasMonthlyPlus = !!monthlyPlusItem;
|
|
1473
|
+
const hasAnnualPlus = !!annualPlusItem;
|
|
1474
|
+
const hasPlusMember = hasMonthlyPlus || hasAnnualPlus;
|
|
1475
|
+
return {
|
|
1476
|
+
hasPlusMember,
|
|
1477
|
+
hasMonthlyPlus,
|
|
1478
|
+
hasAnnualPlus,
|
|
1479
|
+
monthlyPlusItem,
|
|
1480
|
+
annualPlusItem
|
|
1481
|
+
};
|
|
1482
|
+
}
|
|
1483
|
+
function useHasPlusMemberInCart({
|
|
1484
|
+
memberSetting,
|
|
1485
|
+
cart
|
|
1486
|
+
}) {
|
|
1487
|
+
return useMemo(
|
|
1488
|
+
() => hasPlusMemberInCart({
|
|
1489
|
+
memberSetting,
|
|
1490
|
+
cart
|
|
1491
|
+
}),
|
|
1492
|
+
[memberSetting, cart]
|
|
1493
|
+
);
|
|
1484
1494
|
}
|
|
1485
1495
|
var getReferralAttributes = () => {
|
|
1486
1496
|
const inviteCode = getLocalStorage("inviteCode") || Cookies5.get("inviteCode");
|
|
@@ -2459,28 +2469,13 @@ var ShippingMethodMode = /* @__PURE__ */ ((ShippingMethodMode2) => {
|
|
|
2459
2469
|
return ShippingMethodMode2;
|
|
2460
2470
|
})(ShippingMethodMode || {});
|
|
2461
2471
|
var createInitialValue = () => ({
|
|
2462
|
-
zipCode: "",
|
|
2463
2472
|
plusMemberMetafields: {},
|
|
2464
|
-
setZipCode: () => {
|
|
2465
|
-
},
|
|
2466
|
-
allowNextDayDelivery: false,
|
|
2467
|
-
setAllowNextDayDelivery: () => {
|
|
2468
|
-
},
|
|
2469
|
-
allowThirdDayDelivery: false,
|
|
2470
|
-
setAllowThirdDayDelivery: () => {
|
|
2471
|
-
},
|
|
2472
2473
|
selectedPlusMemberMode: "free",
|
|
2473
2474
|
setSelectedPlusMemberMode: () => {
|
|
2474
2475
|
},
|
|
2475
|
-
showAreaCheckModal: false,
|
|
2476
|
-
setShowAreaCheckModal: () => {
|
|
2477
|
-
},
|
|
2478
2476
|
selectedShippingMethod: void 0,
|
|
2479
2477
|
setSelectedShippingMethod: () => {
|
|
2480
2478
|
},
|
|
2481
|
-
showTip: false,
|
|
2482
|
-
setShowTip: () => {
|
|
2483
|
-
},
|
|
2484
2479
|
showMoreShippingMethod: false,
|
|
2485
2480
|
setShowMoreShippingMethod: () => {
|
|
2486
2481
|
},
|
|
@@ -2496,16 +2491,10 @@ var createInitialValue = () => ({
|
|
|
2496
2491
|
isLoadingCoupon: false
|
|
2497
2492
|
},
|
|
2498
2493
|
selectedPlusMemberVariant: void 0,
|
|
2499
|
-
monthlyVariant: void 0,
|
|
2500
|
-
annualVariant: void 0,
|
|
2501
2494
|
showPlusMemberBenefit: false,
|
|
2502
2495
|
setShowPlusMemberBenefit: () => {
|
|
2503
2496
|
},
|
|
2504
|
-
|
|
2505
|
-
setDeleteMarginBottom: () => {
|
|
2506
|
-
},
|
|
2507
|
-
profile: void 0,
|
|
2508
|
-
locale: void 0
|
|
2497
|
+
profile: void 0
|
|
2509
2498
|
});
|
|
2510
2499
|
var PlusMemberContext = createContext(createInitialValue());
|
|
2511
2500
|
function usePlusMemberContext() {
|
|
@@ -2565,9 +2554,9 @@ var useAvailableDeliveryCoupon = ({
|
|
|
2565
2554
|
|
|
2566
2555
|
// src/hooks/member/plus/use-shipping-methods.ts
|
|
2567
2556
|
function useShippingMethods(options) {
|
|
2568
|
-
const { variant, plusMemberMetafields, selectedPlusMemberMode,
|
|
2557
|
+
const { variant, plusMemberMetafields, selectedPlusMemberMode, profile } = options;
|
|
2558
|
+
const isPlus = profile?.isPlus || false;
|
|
2569
2559
|
const { nddCoupon, tddCoupon, isLoading } = useAvailableDeliveryCoupon({ profile });
|
|
2570
|
-
console.log("nddCoupon", nddCoupon);
|
|
2571
2560
|
const { plus_shipping, shippingMethod } = plusMemberMetafields || {};
|
|
2572
2561
|
const nddOverweight = useMemo(() => {
|
|
2573
2562
|
return (variant?.weight || 0) > (shippingMethod?.overWeight_ndd || Infinity);
|
|
@@ -2694,69 +2683,6 @@ function useShippingMethods(options) {
|
|
|
2694
2683
|
isLoadingCoupon: isLoading
|
|
2695
2684
|
};
|
|
2696
2685
|
}
|
|
2697
|
-
function useShippingMethodAvailableCheck() {
|
|
2698
|
-
const {
|
|
2699
|
-
zipCode,
|
|
2700
|
-
allowNextDayDelivery,
|
|
2701
|
-
allowThirdDayDelivery,
|
|
2702
|
-
selectedShippingMethod,
|
|
2703
|
-
setSelectedShippingMethod,
|
|
2704
|
-
setShowTip,
|
|
2705
|
-
shippingMethodsContext
|
|
2706
|
-
} = usePlusMemberContext();
|
|
2707
|
-
useEffect(() => {
|
|
2708
|
-
const freeShippingMethod = shippingMethodsContext.freeShippingMethods[0];
|
|
2709
|
-
const standardShippingMethod = shippingMethodsContext.freeShippingMethods?.find(
|
|
2710
|
-
(item) => item.__mode === "free" /* FREE */
|
|
2711
|
-
);
|
|
2712
|
-
const freeTDD = shippingMethodsContext.freeShippingMethods.find(
|
|
2713
|
-
(item) => item.__mode === "tdd" /* TDD */
|
|
2714
|
-
);
|
|
2715
|
-
const paymentTDD = shippingMethodsContext.paymentShippingMethods.find(
|
|
2716
|
-
(item) => item.__mode === "tdd" /* TDD */
|
|
2717
|
-
);
|
|
2718
|
-
if (zipCode) {
|
|
2719
|
-
console.log(
|
|
2720
|
-
"allowNextDayDelivery, allowThirdDayDelivery:",
|
|
2721
|
-
allowNextDayDelivery,
|
|
2722
|
-
allowThirdDayDelivery
|
|
2723
|
-
);
|
|
2724
|
-
if (!allowNextDayDelivery && !allowThirdDayDelivery) {
|
|
2725
|
-
setShowTip(true);
|
|
2726
|
-
setSelectedShippingMethod(standardShippingMethod);
|
|
2727
|
-
} else {
|
|
2728
|
-
if (selectedShippingMethod?.__mode === "ndd" /* NDD */ && !allowNextDayDelivery) {
|
|
2729
|
-
setShowTip(true);
|
|
2730
|
-
if (allowThirdDayDelivery) {
|
|
2731
|
-
if (selectedShippingMethod.useCoupon) {
|
|
2732
|
-
const method = freeTDD || freeShippingMethod;
|
|
2733
|
-
if (method) setSelectedShippingMethod(method);
|
|
2734
|
-
} else {
|
|
2735
|
-
const method = paymentTDD || freeShippingMethod;
|
|
2736
|
-
if (method) setSelectedShippingMethod(method);
|
|
2737
|
-
}
|
|
2738
|
-
} else {
|
|
2739
|
-
if (freeShippingMethod) setSelectedShippingMethod(freeShippingMethod);
|
|
2740
|
-
}
|
|
2741
|
-
} else if (
|
|
2742
|
-
// TDD 无法使用
|
|
2743
|
-
selectedShippingMethod?.__mode === "tdd" /* TDD */ && !allowThirdDayDelivery
|
|
2744
|
-
) {
|
|
2745
|
-
setShowTip(true);
|
|
2746
|
-
if (freeShippingMethod) setSelectedShippingMethod(freeShippingMethod);
|
|
2747
|
-
}
|
|
2748
|
-
}
|
|
2749
|
-
}
|
|
2750
|
-
}, [
|
|
2751
|
-
allowNextDayDelivery,
|
|
2752
|
-
allowThirdDayDelivery,
|
|
2753
|
-
zipCode,
|
|
2754
|
-
shippingMethodsContext,
|
|
2755
|
-
selectedShippingMethod,
|
|
2756
|
-
setSelectedShippingMethod,
|
|
2757
|
-
setShowTip
|
|
2758
|
-
]);
|
|
2759
|
-
}
|
|
2760
2686
|
var useReplaceCartPlusMember = () => {
|
|
2761
2687
|
const { plusMemberMetafields, selectedPlusMemberMode } = usePlusMemberContext();
|
|
2762
2688
|
const { trigger: removeCartLines2 } = useRemoveCartLines();
|
|
@@ -2788,129 +2714,45 @@ var useReplaceCartPlusMember = () => {
|
|
|
2788
2714
|
]);
|
|
2789
2715
|
return handler;
|
|
2790
2716
|
};
|
|
2791
|
-
var usePlusMemberDeliveryCodes = ({
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
return useMemo(
|
|
2795
|
-
() => deliveryData?.deliveryCustomData?.discount_code,
|
|
2796
|
-
[deliveryData]
|
|
2797
|
-
);
|
|
2798
|
-
};
|
|
2799
|
-
function useUpdateCartDeliveryOptions(mutate, metafieldIdentifiers, options) {
|
|
2800
|
-
const { client, locale, cartCookieAdapter } = useShopify();
|
|
2801
|
-
const updateDeliveryOptions = useCallback(
|
|
2802
|
-
async (_key, { arg }) => {
|
|
2803
|
-
const updatedCart = await updateCartDeliveryOptions(client, {
|
|
2804
|
-
...arg,
|
|
2805
|
-
metafieldIdentifiers,
|
|
2806
|
-
cookieAdapter: cartCookieAdapter
|
|
2807
|
-
});
|
|
2808
|
-
console.log("useUpdateCartDeliveryOptions updatedCart", updatedCart);
|
|
2809
|
-
if (updatedCart) {
|
|
2810
|
-
mutate(updatedCart);
|
|
2811
|
-
}
|
|
2812
|
-
return updatedCart;
|
|
2813
|
-
},
|
|
2814
|
-
[client, locale, cartCookieAdapter, mutate, metafieldIdentifiers]
|
|
2815
|
-
);
|
|
2816
|
-
return useSWRMutation("update-cart-delivery-options", updateDeliveryOptions, options);
|
|
2817
|
-
}
|
|
2818
|
-
|
|
2819
|
-
// src/hooks/member/plus/use-update-plus-member-delivery-options.ts
|
|
2820
|
-
var useUpdatePlusMemberDeliveryOptions = ({
|
|
2821
|
-
options
|
|
2822
|
-
} = {}) => {
|
|
2823
|
-
const { cart: cartContextData, mutateCart, metafieldIdentifiers } = useCartContext();
|
|
2824
|
-
const { trigger: updateCartDeliveryOptions2 } = useUpdateCartDeliveryOptions(
|
|
2825
|
-
mutateCart,
|
|
2826
|
-
metafieldIdentifiers
|
|
2827
|
-
);
|
|
2828
|
-
const handler = useCallback(
|
|
2829
|
-
async (_, { arg }) => {
|
|
2830
|
-
const currentCart = arg?.cart || cartContextData;
|
|
2831
|
-
const { deliveryData } = arg;
|
|
2832
|
-
const firstDeliveryGroup = currentCart?.deliveryGroups?.[0];
|
|
2833
|
-
const deliveryGroupId = firstDeliveryGroup?.id;
|
|
2834
|
-
const selectedOptionCode = deliveryData?.deliveryCustomData?.selected_delivery_option?.code;
|
|
2835
|
-
if (!deliveryGroupId || !selectedOptionCode || selectedOptionCode === firstDeliveryGroup?.selectedDeliveryOption?.code) {
|
|
2836
|
-
return null;
|
|
2837
|
-
}
|
|
2838
|
-
const deliveryGroup = currentCart?.deliveryGroups?.find(
|
|
2839
|
-
(group) => group?.id === deliveryGroupId
|
|
2840
|
-
);
|
|
2841
|
-
const matchedOption = deliveryGroup?.deliveryOptions?.find(
|
|
2842
|
-
(option) => option?.code === selectedOptionCode
|
|
2843
|
-
);
|
|
2844
|
-
if (!matchedOption?.handle) {
|
|
2845
|
-
return null;
|
|
2846
|
-
}
|
|
2847
|
-
const deliveryOptions = [
|
|
2848
|
-
{
|
|
2849
|
-
deliveryGroupId,
|
|
2850
|
-
deliveryOptionHandle: matchedOption.handle
|
|
2851
|
-
}
|
|
2852
|
-
];
|
|
2853
|
-
const updatedCart = await updateCartDeliveryOptions2({
|
|
2854
|
-
selectedDeliveryOptions: deliveryOptions,
|
|
2855
|
-
cartId: currentCart?.id
|
|
2856
|
-
});
|
|
2857
|
-
if (updatedCart && mutateCart) {
|
|
2858
|
-
mutateCart(updatedCart);
|
|
2859
|
-
}
|
|
2860
|
-
return updatedCart;
|
|
2861
|
-
},
|
|
2862
|
-
[cartContextData, updateCartDeliveryOptions2, mutateCart]
|
|
2863
|
-
);
|
|
2864
|
-
return useSWRMutation("update-cart-delivery-options", handler, options);
|
|
2865
|
-
};
|
|
2866
|
-
var usePlusMemberItemCustomAttributes = ({
|
|
2867
|
-
deliveryData
|
|
2868
|
-
}) => {
|
|
2869
|
-
const { deliveryCustomData } = deliveryData || {};
|
|
2870
|
-
return useMemo(() => {
|
|
2871
|
-
const itemCustomAttributes = [];
|
|
2872
|
-
if (deliveryCustomData?.is_presale) {
|
|
2873
|
-
itemCustomAttributes.push({
|
|
2874
|
-
key: "_is_presale",
|
|
2875
|
-
value: "true"
|
|
2876
|
-
});
|
|
2877
|
-
}
|
|
2878
|
-
return itemCustomAttributes;
|
|
2879
|
-
}, [deliveryCustomData]);
|
|
2717
|
+
var usePlusMemberDeliveryCodes = () => {
|
|
2718
|
+
const { selectedShippingMethod } = usePlusMemberContext();
|
|
2719
|
+
return useMemo(() => [selectedShippingMethod?.coupon], [selectedShippingMethod?.coupon]);
|
|
2880
2720
|
};
|
|
2881
2721
|
var usePlusMemberCheckoutCustomAttributes = ({
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
variant,
|
|
2885
|
-
isShowShippingBenefits
|
|
2722
|
+
disableShipping = false,
|
|
2723
|
+
isPresaleContains = false
|
|
2886
2724
|
}) => {
|
|
2887
|
-
const {
|
|
2888
|
-
const { profile } = usePlusMemberContext();
|
|
2725
|
+
const { profile, selectedShippingMethod, selectedPlusMemberMode } = usePlusMemberContext();
|
|
2889
2726
|
return useMemo(() => {
|
|
2890
2727
|
const checkoutCustomAttributes = [
|
|
2891
|
-
// _last_url: 付费会员结算完成之后 checkout 有一个继续购买的按钮, 用于跳转到继续购买的页面
|
|
2892
2728
|
{
|
|
2893
2729
|
key: "_last_url",
|
|
2894
2730
|
value: typeof window !== "undefined" ? window.location.origin + window.location.pathname : ""
|
|
2895
2731
|
}
|
|
2896
2732
|
];
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2733
|
+
checkoutCustomAttributes.push({
|
|
2734
|
+
key: "_checkout_delivery_custom",
|
|
2735
|
+
value: JSON.stringify({
|
|
2736
|
+
allow_nextday_delivery: true,
|
|
2737
|
+
allow_thirdday_delivery: true,
|
|
2738
|
+
selected_delivery_option: {
|
|
2739
|
+
code: selectedShippingMethod?.__code,
|
|
2740
|
+
mode: selectedShippingMethod?.__mode
|
|
2741
|
+
},
|
|
2742
|
+
is_presale: isPresaleContains,
|
|
2743
|
+
discount_code: selectedShippingMethod?.coupon ? [selectedShippingMethod.coupon] : [],
|
|
2744
|
+
plus_type: profile?.isPlus ? "free" /* FREE */ : selectedPlusMemberMode,
|
|
2745
|
+
is_prime: profile?.isPlus
|
|
2746
|
+
})
|
|
2747
|
+
});
|
|
2748
|
+
if (disableShipping) {
|
|
2907
2749
|
checkoutCustomAttributes.push({
|
|
2908
2750
|
key: "_hide_shipping",
|
|
2909
2751
|
value: "true"
|
|
2910
2752
|
});
|
|
2911
2753
|
}
|
|
2912
2754
|
return checkoutCustomAttributes;
|
|
2913
|
-
}, [
|
|
2755
|
+
}, [profile, selectedShippingMethod, selectedPlusMemberMode, isPresaleContains]);
|
|
2914
2756
|
};
|
|
2915
2757
|
function useAutoRemovePlusMemberInCart({
|
|
2916
2758
|
cart,
|
|
@@ -2977,25 +2819,17 @@ var PlusMemberProvider = ({
|
|
|
2977
2819
|
profile,
|
|
2978
2820
|
children
|
|
2979
2821
|
}) => {
|
|
2980
|
-
const { locale } = useShopify();
|
|
2981
|
-
const [zipCode, setZipCode] = useState("");
|
|
2982
|
-
const [showTip, setShowTip] = useState(false);
|
|
2983
2822
|
const [selectedPlusMemberMode, setSelectedPlusMemberMode] = useState(
|
|
2984
2823
|
initialSelectedPlusMemberMode
|
|
2985
2824
|
);
|
|
2986
2825
|
const [selectedShippingMethod, setSelectedShippingMethod] = useState();
|
|
2987
|
-
const [allowNextDayDelivery, setAllowNextDayDelivery] = useState(false);
|
|
2988
|
-
const [allowThirdDayDelivery, setAllowThirdDayDelivery] = useState(false);
|
|
2989
|
-
const [showAreaCheckModal, setShowAreaCheckModal] = useState(false);
|
|
2990
2826
|
const [showMoreShippingMethod, setShowMoreShippingMethod] = useState(false);
|
|
2991
2827
|
const [showPlusMemberBenefit, setShowPlusMemberBenefit] = useState(false);
|
|
2992
|
-
const [deleteMarginBottom, setDeleteMarginBottom] = useState(false);
|
|
2993
2828
|
const shippingMethodsContext = useShippingMethods({
|
|
2994
2829
|
variant,
|
|
2995
2830
|
plusMemberMetafields: memberSetting,
|
|
2996
2831
|
selectedPlusMemberMode,
|
|
2997
|
-
profile
|
|
2998
|
-
isPlus: profile?.isPlus || false
|
|
2832
|
+
profile
|
|
2999
2833
|
});
|
|
3000
2834
|
const { monthlyVariant, annualVariant } = usePlusMemberVariants({
|
|
3001
2835
|
memberSetting
|
|
@@ -3011,34 +2845,19 @@ var PlusMemberProvider = ({
|
|
|
3011
2845
|
{
|
|
3012
2846
|
value: {
|
|
3013
2847
|
variant,
|
|
3014
|
-
zipCode,
|
|
3015
|
-
setZipCode,
|
|
3016
|
-
allowNextDayDelivery,
|
|
3017
|
-
setAllowNextDayDelivery,
|
|
3018
|
-
allowThirdDayDelivery,
|
|
3019
|
-
setAllowThirdDayDelivery,
|
|
3020
2848
|
plusMemberMetafields: memberSetting,
|
|
3021
2849
|
selectedPlusMemberMode,
|
|
3022
2850
|
setSelectedPlusMemberMode,
|
|
3023
|
-
showAreaCheckModal,
|
|
3024
|
-
setShowAreaCheckModal,
|
|
3025
2851
|
selectedShippingMethod,
|
|
3026
2852
|
setSelectedShippingMethod,
|
|
3027
2853
|
shippingMethodsContext,
|
|
3028
|
-
showTip,
|
|
3029
|
-
setShowTip,
|
|
3030
2854
|
showMoreShippingMethod,
|
|
3031
2855
|
setShowMoreShippingMethod,
|
|
3032
2856
|
selectedPlusMemberVariant,
|
|
3033
|
-
monthlyVariant,
|
|
3034
|
-
annualVariant,
|
|
3035
2857
|
product,
|
|
3036
2858
|
showPlusMemberBenefit,
|
|
3037
2859
|
setShowPlusMemberBenefit,
|
|
3038
|
-
|
|
3039
|
-
setDeleteMarginBottom,
|
|
3040
|
-
profile,
|
|
3041
|
-
locale
|
|
2860
|
+
profile
|
|
3042
2861
|
},
|
|
3043
2862
|
children
|
|
3044
2863
|
}
|
|
@@ -3224,6 +3043,6 @@ function clearGeoLocationCache(cacheKey = "geoLocation") {
|
|
|
3224
3043
|
}
|
|
3225
3044
|
}
|
|
3226
3045
|
|
|
3227
|
-
export { BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, DeliveryPlusType, MAIN_PRODUCT_CODE, MEMBER_PRICE_ATTRIBUTE_KEY, OrderBasePriceType, OrderDiscountType, PLUS_MEMBER_TYPE, PlusMemberContext, PlusMemberMode, PlusMemberProvider, PriceBasePriceType, PriceDiscountType, RuleType, SCRIPT_CODE_AMOUNT_KEY, ShippingMethodMode, SpendMoneyType, checkAttributesUpdateNeeded, clearGeoLocationCache, createMockCartFromLines, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, getCachedGeoLocation, getDiscountEnvAttributeValue, getMatchedMainProductSubTotal, getQuery, getReferralAttributes, normalizeAddToCartLines, preCheck, safeParse, useAddCartLines, useAddToCart, useAllBlogs, useAllCollections, useAllProducts, useApplyCartCodes, useArticle, useArticles, useArticlesInBlog, useAutoRemovePlusMemberInCart, useAvailableDeliveryCoupon, useBlog, useBuyNow, useCalcAutoFreeGift, useCalcGiftsFromLines, useCalcOrderDiscount, useCartAttributes, useCartItemQuantityLimit, useCollection, useCollections, useCreateCart, useExposure, useGeoLocation, useHasPlusMemberInCart, useIntersection, usePlusMemberCheckoutCustomAttributes, usePlusMemberContext, usePlusMemberDeliveryCodes,
|
|
3046
|
+
export { BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, DeliveryPlusType, MAIN_PRODUCT_CODE, MEMBER_PRICE_ATTRIBUTE_KEY, OrderBasePriceType, OrderDiscountType, PLUS_MEMBER_TYPE, PlusMemberContext, PlusMemberMode, PlusMemberProvider, PriceBasePriceType, PriceDiscountType, RuleType, SCRIPT_CODE_AMOUNT_KEY, ShippingMethodMode, SpendMoneyType, checkAttributesUpdateNeeded, clearGeoLocationCache, createMockCartFromLines, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, getCachedGeoLocation, getDiscountEnvAttributeValue, getMatchedMainProductSubTotal, getQuery, getReferralAttributes, hasPlusMemberInCart, normalizeAddToCartLines, preCheck, safeParse, useAddCartLines, useAddToCart, useAllBlogs, useAllCollections, useAllProducts, useApplyCartCodes, useArticle, useArticles, useArticlesInBlog, useAutoRemovePlusMemberInCart, useAvailableDeliveryCoupon, useBlog, useBuyNow, useCalcAutoFreeGift, useCalcGiftsFromLines, useCalcOrderDiscount, useCartAttributes, useCartItemQuantityLimit, useCollection, useCollections, useCreateCart, useExposure, useGeoLocation, useHasPlusMemberInCart, useIntersection, usePlusMemberCheckoutCustomAttributes, usePlusMemberContext, usePlusMemberDeliveryCodes, usePlusMemberNeedAddToCart, usePlusMemberVariants, usePrice, useProduct, useProductUrl, useProductsByHandles, useRemoveCartCodes, useRemoveCartLines, useReplaceCartPlusMember, useScriptAutoFreeGift, useSearch, useSelectedOptions, useShippingMethods, useSite, useUpdateCartAttributes, useUpdateCartLines, useUpdateLineCodeAmountAttributes, useUpdateVariantQuery, useVariant, useVariantMedia };
|
|
3228
3047
|
//# sourceMappingURL=index.mjs.map
|
|
3229
3048
|
//# sourceMappingURL=index.mjs.map
|