@anker-in/shopify-react 0.1.1-beta.1 → 0.1.1-beta.10
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 +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +323 -68
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +318 -68
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/{index-RevQokdZ.d.mts → index-CwP6qHUo.d.mts} +195 -63
- package/dist/{index-CCMIeIUh.d.ts → index-Dwc-_zEo.d.ts} +195 -63
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +346 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +341 -78
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +3 -1
- package/dist/provider/index.d.ts +3 -1
- package/dist/provider/index.js +147 -41
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +147 -41
- package/dist/provider/index.mjs.map +1 -1
- package/dist/{types-CICUnw0v.d.mts → types-CUv-lzQk.d.mts} +5 -3
- package/dist/{types-CICUnw0v.d.ts → types-CUv-lzQk.d.ts} +5 -3
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useMemo, useContext, useRef, useState, useEffect, useCallback } from 'react';
|
|
2
|
-
import { createShopifyClient, getProductsByHandles, createCart, updateCartCodes, addCartLines, updateCartLines, removeCartLines, updateCartAttributes, getProduct, getAllProducts, getCollection, getAllCollections, getCollections, getBlog, getAllBlogs, getArticle, getArticles, getArticlesInBlog, getLocalStorage, getCart, setLocalStorage } from '@anker-in/shopify-sdk';
|
|
2
|
+
import { createShopifyClient, getProductsByHandles, createCart, updateCartCodes, addCartLines, updateCartLines, removeCartLines, updateCartAttributes, getProduct, getAllProducts, getCollection, getAllCollections, getCollections, getBlog, getAllBlogs, getArticle, getArticles, getArticlesInBlog, getLocalStorage, getCart, setLocalStorage, updateCartDeliveryOptions } from '@anker-in/shopify-sdk';
|
|
3
3
|
export { ShopifyConfig, clearLocalStorage, createShopifyClient, getLocalStorage, removeLocalStorage, setLocalStorage } from '@anker-in/shopify-sdk';
|
|
4
4
|
import Cookies5 from 'js-cookie';
|
|
5
5
|
import { jsx } from 'react/jsx-runtime';
|
|
@@ -134,6 +134,81 @@ var CODE_AMOUNT_KEY = "_sku_code_money";
|
|
|
134
134
|
var SCRIPT_CODE_AMOUNT_KEY = "_code_money";
|
|
135
135
|
var MAIN_PRODUCT_CODE = ["WS24", "WSTD", "WS7D", "WSCP", "WSPE", "WSPD"];
|
|
136
136
|
|
|
137
|
+
// src/hooks/cart/utils/normalize-add-to-cart-lines.ts
|
|
138
|
+
function normalizeAddToCartLines(lines) {
|
|
139
|
+
return lines.filter((line) => line.variant?.id).map((line, index) => {
|
|
140
|
+
const variant = line.variant;
|
|
141
|
+
const product = variant.product;
|
|
142
|
+
const quantity = line.quantity || 1;
|
|
143
|
+
const price = variant.finalPrice?.amount ? Number(variant.finalPrice.amount) : variant.compareAtPrice?.amount ? Number(variant.compareAtPrice.amount) : variant.price?.amount ? Number(variant.price.amount) : 0;
|
|
144
|
+
const subtotalAmount = price * quantity;
|
|
145
|
+
const totalAmount = subtotalAmount;
|
|
146
|
+
return {
|
|
147
|
+
id: `temp-line-${index}-${variant.id}`,
|
|
148
|
+
// Temporary ID for pre-cart lines
|
|
149
|
+
name: product?.title || variant.title || "",
|
|
150
|
+
quantity,
|
|
151
|
+
variantId: variant.id,
|
|
152
|
+
productId: product?.id || variant.id.split("/").slice(0, -2).join("/"),
|
|
153
|
+
totalAmount,
|
|
154
|
+
subtotalAmount,
|
|
155
|
+
discountAllocations: [],
|
|
156
|
+
customAttributes: line.attributes || [],
|
|
157
|
+
variant: {
|
|
158
|
+
id: variant.id,
|
|
159
|
+
price,
|
|
160
|
+
listPrice: variant.compareAtPrice?.amount ? Number(variant.compareAtPrice.amount) : 0,
|
|
161
|
+
sku: variant.sku || "",
|
|
162
|
+
name: variant.title || "",
|
|
163
|
+
image: variant.image ? {
|
|
164
|
+
url: variant.image.url,
|
|
165
|
+
altText: variant.image.altText || void 0
|
|
166
|
+
} : void 0,
|
|
167
|
+
requiresShipping: false,
|
|
168
|
+
// Default value, not available in NormalizedProductVariant
|
|
169
|
+
availableForSale: variant.availableForSale ?? true,
|
|
170
|
+
quantityAvailable: variant.quantityAvailable ?? 0,
|
|
171
|
+
currentlyNotInStock: false,
|
|
172
|
+
// Default value, will be updated when added to cart
|
|
173
|
+
weight: variant.weight,
|
|
174
|
+
metafields: variant.metafields
|
|
175
|
+
},
|
|
176
|
+
product,
|
|
177
|
+
path: product?.handle ? `/products/${product.handle}` : "",
|
|
178
|
+
discounts: [],
|
|
179
|
+
options: variant.selectedOptions?.map((opt) => ({
|
|
180
|
+
name: opt.name,
|
|
181
|
+
value: opt.value
|
|
182
|
+
}))
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
function createMockCartFromLines(lines, existingCart) {
|
|
187
|
+
const normalizedLines = normalizeAddToCartLines(lines);
|
|
188
|
+
const subtotalPrice = normalizedLines.reduce((sum, line) => sum + line.subtotalAmount, 0);
|
|
189
|
+
const totalPrice = normalizedLines.reduce((sum, line) => sum + line.totalAmount, 0);
|
|
190
|
+
return {
|
|
191
|
+
id: existingCart?.id || "temp-cart-id",
|
|
192
|
+
customerId: existingCart?.customerId,
|
|
193
|
+
email: existingCart?.email,
|
|
194
|
+
createdAt: existingCart?.createdAt || (/* @__PURE__ */ new Date()).toISOString(),
|
|
195
|
+
currency: existingCart?.currency || { code: "USD" },
|
|
196
|
+
taxesIncluded: existingCart?.taxesIncluded,
|
|
197
|
+
lineItems: normalizedLines,
|
|
198
|
+
totalLineItemsDiscount: 0,
|
|
199
|
+
orderDiscounts: 0,
|
|
200
|
+
lineItemsSubtotalPrice: subtotalPrice,
|
|
201
|
+
subtotalPrice,
|
|
202
|
+
totalPrice,
|
|
203
|
+
totalTaxAmount: 0,
|
|
204
|
+
discountCodes: existingCart?.discountCodes || [],
|
|
205
|
+
discountAllocations: [],
|
|
206
|
+
url: existingCart?.url || "",
|
|
207
|
+
ready: true,
|
|
208
|
+
customAttributes: existingCart?.customAttributes
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
|
|
137
212
|
// src/hooks/cart/utils/index.ts
|
|
138
213
|
var getQuery = () => {
|
|
139
214
|
const url = typeof window !== "undefined" ? window.location.search : "";
|
|
@@ -173,25 +248,25 @@ var getMatchedMainProductSubTotal = (cartData, variant_list, main_product) => {
|
|
|
173
248
|
return acc + (main_product?.spend_money_type === 1 /* ORIGIN_PRICE */ ? Number(line.subtotalAmount) || 0 : Number(line.totalAmount) || 0);
|
|
174
249
|
}, 0) || 0;
|
|
175
250
|
};
|
|
176
|
-
var
|
|
177
|
-
const attr = attributes.find((attr2) => attr2.key === CUSTOMER_ATTRIBUTE_KEY);
|
|
178
|
-
return safeParseJson(attr?.value ?? "") ?? {};
|
|
179
|
-
};
|
|
180
|
-
var isAttributesEqual = (attrs1 = [], attrs2 = []) => {
|
|
181
|
-
if (attrs1.length !== attrs2.length) return false;
|
|
182
|
-
const sorted1 = [...attrs1].sort((a, b) => a.key.localeCompare(b.key));
|
|
183
|
-
const sorted2 = [...attrs2].sort((a, b) => a.key.localeCompare(b.key));
|
|
184
|
-
return sorted1.every(
|
|
185
|
-
(attr, i) => attr.key === sorted2[i]?.key && attr.value === sorted2[i]?.value
|
|
186
|
-
);
|
|
187
|
-
};
|
|
188
|
-
var safeParseJson = (str) => {
|
|
251
|
+
var safeParse = (str) => {
|
|
189
252
|
try {
|
|
190
253
|
return JSON.parse(str);
|
|
191
254
|
} catch (err) {
|
|
192
255
|
return {};
|
|
193
256
|
}
|
|
194
257
|
};
|
|
258
|
+
var getDiscountEnvAttributeValue = (attributes = []) => {
|
|
259
|
+
const attr = attributes.find((attr2) => attr2.key === CUSTOMER_ATTRIBUTE_KEY);
|
|
260
|
+
return safeParse(attr?.value ?? "") ?? {};
|
|
261
|
+
};
|
|
262
|
+
var checkAttributesUpdateNeeded = (oldAttributes, newAttributes, customAttributesNeedRemove) => {
|
|
263
|
+
return oldAttributes.some((attr) => {
|
|
264
|
+
const newAttr = newAttributes.find((newAttr2) => newAttr2.key === attr.key);
|
|
265
|
+
return newAttr ? newAttr.value !== attr.value : true;
|
|
266
|
+
}) || newAttributes.some((attr) => !oldAttributes.some((oldAttr) => oldAttr.key === attr.key)) || customAttributesNeedRemove.some(
|
|
267
|
+
(removeAttr) => oldAttributes.some((oldAttr) => oldAttr.key === removeAttr.key)
|
|
268
|
+
);
|
|
269
|
+
};
|
|
195
270
|
var containsAll = (source, requiredItems = []) => {
|
|
196
271
|
if (!requiredItems?.length) return true;
|
|
197
272
|
const sourceSet = new Set(source);
|
|
@@ -358,12 +433,18 @@ var formatFunctionAutoFreeGift = ({
|
|
|
358
433
|
};
|
|
359
434
|
return result;
|
|
360
435
|
};
|
|
361
|
-
var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer) => {
|
|
436
|
+
var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer, lines) => {
|
|
362
437
|
const tags = useMemo(() => customer?.tags || [], [customer?.tags]);
|
|
363
438
|
const isCustomerLoading = useMemo(() => !customer ? true : false, [customer]);
|
|
364
439
|
const dealsType = "";
|
|
365
440
|
const { client, locale } = useShopify();
|
|
366
441
|
const giftProductsCache = useRef(null);
|
|
442
|
+
const effectiveCart = useMemo(() => {
|
|
443
|
+
if (lines && lines.length > 0) {
|
|
444
|
+
return createMockCartFromLines(lines, cart);
|
|
445
|
+
}
|
|
446
|
+
return cart;
|
|
447
|
+
}, [lines, cart]);
|
|
367
448
|
const { activeCampaign, subtotal } = useMemo(() => {
|
|
368
449
|
for (const campaign of autoFreeGiftConfig) {
|
|
369
450
|
const { rule_conditions = [], rule_result } = campaign;
|
|
@@ -371,7 +452,7 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer) => {
|
|
|
371
452
|
const isPreCheckPassed = preCheck(rule_conditions, tags, []);
|
|
372
453
|
if (isPreCheckPassed && spend_get_reward) {
|
|
373
454
|
const matchedSubtotal = getMatchedMainProductSubTotal(
|
|
374
|
-
|
|
455
|
+
effectiveCart,
|
|
375
456
|
spend_get_reward.main_product?.variant_list?.map((v) => v.variant_id) || [],
|
|
376
457
|
{
|
|
377
458
|
spend_money_type: spend_get_reward.main_product?.spend_money_type || 1,
|
|
@@ -385,13 +466,13 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer) => {
|
|
|
385
466
|
}
|
|
386
467
|
}
|
|
387
468
|
return { activeCampaign: null, subtotal: 0 };
|
|
388
|
-
}, [autoFreeGiftConfig,
|
|
469
|
+
}, [autoFreeGiftConfig, effectiveCart, tags, dealsType]);
|
|
389
470
|
const { qualifyingGift, nextTierGoal } = useMemo(() => {
|
|
390
471
|
if (!activeCampaign || !activeCampaign.rule_result?.spend_get_reward?.gift_product) {
|
|
391
472
|
return { qualifyingGift: null, nextTierGoal: null };
|
|
392
473
|
}
|
|
393
474
|
const giftTiers = activeCampaign.rule_result.spend_get_reward.gift_product;
|
|
394
|
-
const qualifyingTier = [...giftTiers].
|
|
475
|
+
const qualifyingTier = [...giftTiers].sort((a, b) => Number(b.spend_sum_money) - Number(a.spend_sum_money)).find((tier) => subtotal >= Number(tier.spend_sum_money));
|
|
395
476
|
const nextGoal = giftTiers.find((tier) => subtotal < Number(tier.spend_sum_money));
|
|
396
477
|
if (!qualifyingTier) {
|
|
397
478
|
return { qualifyingGift: null, nextTierGoal: nextGoal || null };
|
|
@@ -468,18 +549,33 @@ var useScriptAutoFreeGift = ({
|
|
|
468
549
|
campaign,
|
|
469
550
|
_giveaway,
|
|
470
551
|
cart,
|
|
471
|
-
locale: providedLocale
|
|
552
|
+
locale: providedLocale,
|
|
553
|
+
lines
|
|
472
554
|
}) => {
|
|
473
555
|
const { client, locale: contextLocale } = useShopify();
|
|
474
556
|
const locale = providedLocale || contextLocale;
|
|
475
557
|
const [points_subscribe, set_points_subscribe] = useState(false);
|
|
476
558
|
const giftProductsCache = useRef(null);
|
|
559
|
+
const effectiveCart = useMemo(() => {
|
|
560
|
+
if (lines && lines.length > 0) {
|
|
561
|
+
return createMockCartFromLines(lines, cart);
|
|
562
|
+
}
|
|
563
|
+
return cart;
|
|
564
|
+
}, [lines, cart]);
|
|
477
565
|
useEffect(() => {
|
|
478
566
|
if (locale === "au") {
|
|
479
567
|
const isPointsSubscribe = Cookies5.get("points_subscribe");
|
|
480
568
|
set_points_subscribe(!!isPointsSubscribe);
|
|
481
569
|
}
|
|
482
570
|
}, [locale]);
|
|
571
|
+
const isActivityAvailable = useMemo(() => {
|
|
572
|
+
if (!campaign) return false;
|
|
573
|
+
const query = getQuery();
|
|
574
|
+
const utmCampaign = Cookies5.get("utm_campaign") || query?.utm_campaign;
|
|
575
|
+
if (campaign.activityAvailableQuery && !utmCampaign?.includes(campaign.activityAvailableQuery))
|
|
576
|
+
return false;
|
|
577
|
+
return true;
|
|
578
|
+
}, [campaign]);
|
|
483
579
|
const [upgrade_multiple, upgrade_value] = useMemo(() => {
|
|
484
580
|
let upgrade_multiple2 = 1;
|
|
485
581
|
let upgrade_value2 = 0;
|
|
@@ -487,17 +583,17 @@ var useScriptAutoFreeGift = ({
|
|
|
487
583
|
upgrade_multiple2 = 1.2;
|
|
488
584
|
upgrade_value2 = 40;
|
|
489
585
|
}
|
|
490
|
-
|
|
586
|
+
effectiveCart?.lineItems?.forEach(({ customAttributes }) => {
|
|
491
587
|
customAttributes?.forEach(({ key, value }) => {
|
|
492
588
|
if (key === "_amount_upgrade_multiple") upgrade_multiple2 = Number(value) || 1;
|
|
493
589
|
if (key === "_amount_upgrade_value") upgrade_value2 = Number(value) || 0;
|
|
494
590
|
});
|
|
495
591
|
});
|
|
496
592
|
return [upgrade_multiple2, upgrade_value2];
|
|
497
|
-
}, [
|
|
593
|
+
}, [effectiveCart?.lineItems, points_subscribe]);
|
|
498
594
|
const breakpoints = useMemo(() => {
|
|
499
|
-
if (!
|
|
500
|
-
return (campaign
|
|
595
|
+
if (!isActivityAvailable) return [];
|
|
596
|
+
return (campaign?.breakpoints || []).map((item) => ({
|
|
501
597
|
breakpoint: new Decimal2(item.breakpoint).minus(new Decimal2(upgrade_value)).dividedBy(new Decimal2(upgrade_multiple)).toFixed(2, Decimal2.ROUND_DOWN),
|
|
502
598
|
giveawayProducts: item.giveawayProducts || []
|
|
503
599
|
}));
|
|
@@ -521,25 +617,26 @@ var useScriptAutoFreeGift = ({
|
|
|
521
617
|
return true;
|
|
522
618
|
}, [giftHandles]);
|
|
523
619
|
const involvedLines = useMemo(() => {
|
|
524
|
-
if (!
|
|
525
|
-
return (
|
|
620
|
+
if (!isActivityAvailable) return [];
|
|
621
|
+
return (effectiveCart?.lineItems || []).filter((line) => {
|
|
526
622
|
const isNotGift = line?.totalAmount && Number(line.totalAmount) > 0 && line.customAttributes?.every(
|
|
527
623
|
(item) => item.key !== _giveaway
|
|
528
624
|
);
|
|
529
625
|
const hasCampaignTag = line.product?.tags?.some(
|
|
530
|
-
(tag) => campaign
|
|
626
|
+
(tag) => campaign?.includeTags?.includes(tag.trim()) && line.variant?.availableForSale
|
|
531
627
|
);
|
|
532
628
|
return isNotGift && hasCampaignTag;
|
|
533
629
|
});
|
|
534
|
-
}, [
|
|
630
|
+
}, [effectiveCart?.lineItems, isActivityAvailable, _giveaway]);
|
|
535
631
|
const involvedSubTotal = useMemo(() => {
|
|
536
|
-
if (!
|
|
632
|
+
if (!isActivityAvailable) return new Decimal2(0);
|
|
537
633
|
return involvedLines.reduce((prev, item) => {
|
|
538
|
-
const amount = campaign
|
|
634
|
+
const amount = campaign?.useTotalAmount ? item.totalAmount : item.subtotalAmount;
|
|
539
635
|
return new Decimal2(prev).plus(new Decimal2(amount || 0));
|
|
540
636
|
}, new Decimal2(0));
|
|
541
|
-
}, [involvedLines,
|
|
637
|
+
}, [involvedLines, isActivityAvailable]);
|
|
542
638
|
const [freeGiftLevel, nextFreeGiftLevel] = useMemo(() => {
|
|
639
|
+
if (!isActivityAvailable) return [null, null];
|
|
543
640
|
const sortedLevels = [...breakpoints].sort(
|
|
544
641
|
(a, b) => Number(b.breakpoint) - Number(a.breakpoint)
|
|
545
642
|
);
|
|
@@ -683,8 +780,12 @@ var trackAddToCartGA = ({
|
|
|
683
780
|
}
|
|
684
781
|
const { variant } = lineItems[0];
|
|
685
782
|
const currencyCode = variant.product?.price?.currencyCode;
|
|
686
|
-
const
|
|
687
|
-
|
|
783
|
+
const totalPrice = lineItems?.reduce(
|
|
784
|
+
(prev, { variant: variant2 }) => prev.plus(
|
|
785
|
+
variant2?.finalPrice?.amount ?? variant2?.compareAtPrice?.amount ?? variant2?.price?.amount ?? 0
|
|
786
|
+
),
|
|
787
|
+
new Decimal2(0)
|
|
788
|
+
).toNumber();
|
|
688
789
|
gaTrack({
|
|
689
790
|
event: "ga4Event",
|
|
690
791
|
event_name: "add_to_cart",
|
|
@@ -699,7 +800,7 @@ var trackAddToCartGA = ({
|
|
|
699
800
|
item_brand: gtmParams?.brand || "",
|
|
700
801
|
item_category: variant2?.product?.productType || "",
|
|
701
802
|
item_variant: variant2?.title || variant2?.title,
|
|
702
|
-
price,
|
|
803
|
+
price: variant2?.compareAtPrice?.amount ?? variant2?.price?.amount,
|
|
703
804
|
quantity: quantity || 1
|
|
704
805
|
})),
|
|
705
806
|
...gtmParams?.ga4Params
|
|
@@ -714,9 +815,12 @@ var trackBeginCheckoutGA = ({
|
|
|
714
815
|
if (!lineItems.length) {
|
|
715
816
|
return;
|
|
716
817
|
}
|
|
717
|
-
const
|
|
718
|
-
|
|
719
|
-
|
|
818
|
+
const totalPrice = lineItems?.reduce(
|
|
819
|
+
(prev, { variant }) => prev.plus(
|
|
820
|
+
variant?.finalPrice?.amount ?? variant?.compareAtPrice?.amount ?? variant?.price?.amount ?? 0
|
|
821
|
+
),
|
|
822
|
+
new Decimal2(0)
|
|
823
|
+
).toNumber();
|
|
720
824
|
gaTrack({
|
|
721
825
|
event: "ga4Event",
|
|
722
826
|
event_name: "begin_checkout",
|
|
@@ -731,7 +835,7 @@ var trackBeginCheckoutGA = ({
|
|
|
731
835
|
item_brand: gtmParams?.brand || "",
|
|
732
836
|
item_category: item.variant?.product?.productType,
|
|
733
837
|
item_variant: item.variant?.title,
|
|
734
|
-
price,
|
|
838
|
+
price: item.variant?.compareAtPrice?.amount ?? item.variant?.price?.amount,
|
|
735
839
|
quantity: item.quantity || 1
|
|
736
840
|
})),
|
|
737
841
|
...gtmParams?.ga4Params
|
|
@@ -747,8 +851,12 @@ var trackBuyNowGA = ({
|
|
|
747
851
|
}
|
|
748
852
|
const { variant } = lineItems[0];
|
|
749
853
|
const currencyCode = variant.price?.currencyCode;
|
|
750
|
-
const
|
|
751
|
-
|
|
854
|
+
const totalPrice = lineItems?.reduce(
|
|
855
|
+
(prev, { variant: variant2 }) => prev.plus(
|
|
856
|
+
variant2?.finalPrice?.amount ?? variant2?.compareAtPrice?.amount ?? (variant2?.price?.amount || 0)
|
|
857
|
+
),
|
|
858
|
+
new Decimal2(0)
|
|
859
|
+
).toNumber();
|
|
752
860
|
gaTrack({
|
|
753
861
|
event: "ga4Event",
|
|
754
862
|
event_name: "begin_checkout",
|
|
@@ -763,7 +871,7 @@ var trackBuyNowGA = ({
|
|
|
763
871
|
item_brand: gtmParams?.brand || "",
|
|
764
872
|
item_category: item.variant?.product?.productType || "",
|
|
765
873
|
item_variant: item.variant?.title,
|
|
766
|
-
price,
|
|
874
|
+
price: item.variant?.compareAtPrice?.amount ?? item.variant?.price?.amount,
|
|
767
875
|
quantity: item.quantity || 1
|
|
768
876
|
})),
|
|
769
877
|
...gtmParams?.ga4Params
|
|
@@ -906,6 +1014,7 @@ function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
|
906
1014
|
if (!resultCart) {
|
|
907
1015
|
return void 0;
|
|
908
1016
|
}
|
|
1017
|
+
console.log("npm addCartLines resultCart", resultCart);
|
|
909
1018
|
if (resultCart.discountCodes && resultCart.discountCodes.length > 0) {
|
|
910
1019
|
const unapplicableCodes = resultCart.discountCodes.filter((item) => !item.applicable).map((item) => item.code);
|
|
911
1020
|
if (unapplicableCodes.length > 0) {
|
|
@@ -1079,6 +1188,60 @@ function useBuyNow({ withTrack = true } = {}, swrOptions) {
|
|
|
1079
1188
|
);
|
|
1080
1189
|
return useSWRMutation("buy-now", buyNow, swrOptions);
|
|
1081
1190
|
}
|
|
1191
|
+
function useCalcGiftsFromLines({
|
|
1192
|
+
lines,
|
|
1193
|
+
customer,
|
|
1194
|
+
scriptGiveawayKey = CUSTOMER_SCRIPT_GIFT_KEY
|
|
1195
|
+
}) {
|
|
1196
|
+
const { locale } = useShopify();
|
|
1197
|
+
const { cart, autoFreeGiftConfig, gradientGiftsConfig } = useCartContext();
|
|
1198
|
+
const functionGift = useCalcAutoFreeGift(cart, autoFreeGiftConfig || [], customer, lines);
|
|
1199
|
+
const scriptGift = useScriptAutoFreeGift({
|
|
1200
|
+
campaign: gradientGiftsConfig || null,
|
|
1201
|
+
_giveaway: scriptGiveawayKey,
|
|
1202
|
+
cart,
|
|
1203
|
+
locale,
|
|
1204
|
+
lines
|
|
1205
|
+
});
|
|
1206
|
+
const allGiftLines = useMemo(() => {
|
|
1207
|
+
const functionGiftLines = functionGift.qualifyingGift?.itemsToAdd || [];
|
|
1208
|
+
const scriptGiftLines = scriptGift.freeGiftLevel ? scriptGift.freeGiftLevel.giveawayProducts.map((product) => {
|
|
1209
|
+
const giftProduct = scriptGift.giftProductsResult?.find(
|
|
1210
|
+
(p) => p.handle === product.handle
|
|
1211
|
+
);
|
|
1212
|
+
const variant = giftProduct?.variants?.[0];
|
|
1213
|
+
return {
|
|
1214
|
+
variant: {
|
|
1215
|
+
id: variant?.id || "",
|
|
1216
|
+
handle: product.handle,
|
|
1217
|
+
sku: product.sku
|
|
1218
|
+
},
|
|
1219
|
+
quantity: 1,
|
|
1220
|
+
attributes: [
|
|
1221
|
+
{
|
|
1222
|
+
key: scriptGiveawayKey,
|
|
1223
|
+
value: "true"
|
|
1224
|
+
}
|
|
1225
|
+
]
|
|
1226
|
+
};
|
|
1227
|
+
}).filter((item) => item.variant.id) : [];
|
|
1228
|
+
return [...functionGiftLines, ...scriptGiftLines];
|
|
1229
|
+
}, [
|
|
1230
|
+
functionGift.qualifyingGift,
|
|
1231
|
+
scriptGift.freeGiftLevel,
|
|
1232
|
+
scriptGift.giftProductsResult,
|
|
1233
|
+
scriptGiveawayKey
|
|
1234
|
+
]);
|
|
1235
|
+
const hasGifts = useMemo(() => {
|
|
1236
|
+
return allGiftLines.length > 0;
|
|
1237
|
+
}, [allGiftLines]);
|
|
1238
|
+
return {
|
|
1239
|
+
functionGift,
|
|
1240
|
+
scriptGift,
|
|
1241
|
+
allGiftLines,
|
|
1242
|
+
hasGifts
|
|
1243
|
+
};
|
|
1244
|
+
}
|
|
1082
1245
|
|
|
1083
1246
|
// src/hooks/cart/types/order-discount.ts
|
|
1084
1247
|
var OrderDiscountType = /* @__PURE__ */ ((OrderDiscountType2) => {
|
|
@@ -1228,8 +1391,6 @@ var useCartAttributes = ({
|
|
|
1228
1391
|
memberSetting,
|
|
1229
1392
|
cart
|
|
1230
1393
|
});
|
|
1231
|
-
console.log("memberSetting", memberSetting);
|
|
1232
|
-
console.log("hasPlusMember", hasPlusMember);
|
|
1233
1394
|
useEffect(() => {
|
|
1234
1395
|
setCurrentUrl(window.location.href);
|
|
1235
1396
|
}, []);
|
|
@@ -1278,15 +1439,19 @@ var useCartAttributes = ({
|
|
|
1278
1439
|
];
|
|
1279
1440
|
}, [profile?.memberType, profile?.token, userType, hasPlusMember]);
|
|
1280
1441
|
const functionAttributes = useMemo(() => {
|
|
1281
|
-
|
|
1282
|
-
|
|
1442
|
+
const hasFunctionEnvAttribute = cart?.lineItems.some(
|
|
1443
|
+
(item) => item.customAttributes?.some((attr) => attr.key === CUSTOMER_ATTRIBUTE_KEY)
|
|
1444
|
+
);
|
|
1445
|
+
const discountCodes = cart?.discountCodes.map((item) => item.code).filter((code) => code) || [];
|
|
1446
|
+
return hasFunctionEnvAttribute ? [
|
|
1447
|
+
{
|
|
1283
1448
|
key: "_discounts_function_env",
|
|
1284
1449
|
value: JSON.stringify({
|
|
1285
|
-
discount_code:
|
|
1450
|
+
discount_code: discountCodes,
|
|
1286
1451
|
user_tags: customer?.tags || []
|
|
1287
1452
|
})
|
|
1288
1453
|
}
|
|
1289
|
-
];
|
|
1454
|
+
] : [];
|
|
1290
1455
|
}, [cart]);
|
|
1291
1456
|
const presellAttributes = useMemo(() => {
|
|
1292
1457
|
return [
|
|
@@ -2463,6 +2628,69 @@ var usePlusMemberDeliveryCodes = ({
|
|
|
2463
2628
|
[deliveryData]
|
|
2464
2629
|
);
|
|
2465
2630
|
};
|
|
2631
|
+
function useUpdateCartDeliveryOptions(mutate, metafieldIdentifiers, options) {
|
|
2632
|
+
const { client, locale, cartCookieAdapter } = useShopify();
|
|
2633
|
+
const updateDeliveryOptions = useCallback(
|
|
2634
|
+
async (_key, { arg }) => {
|
|
2635
|
+
const updatedCart = await updateCartDeliveryOptions(client, {
|
|
2636
|
+
...arg,
|
|
2637
|
+
metafieldIdentifiers,
|
|
2638
|
+
cookieAdapter: cartCookieAdapter
|
|
2639
|
+
});
|
|
2640
|
+
console.log("useUpdateCartDeliveryOptions updatedCart", updatedCart);
|
|
2641
|
+
if (updatedCart) {
|
|
2642
|
+
mutate(updatedCart);
|
|
2643
|
+
}
|
|
2644
|
+
return updatedCart;
|
|
2645
|
+
},
|
|
2646
|
+
[client, locale, cartCookieAdapter, mutate]
|
|
2647
|
+
);
|
|
2648
|
+
return useSWRMutation("update-cart-delivery-options", updateDeliveryOptions, options);
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
// src/hooks/member/plus/use-update-plus-member-delivery-options.ts
|
|
2652
|
+
var useUpdatePlusMemberDeliveryOptions = ({
|
|
2653
|
+
options
|
|
2654
|
+
}) => {
|
|
2655
|
+
const { cart, mutateCart: mutate, metafieldIdentifiers } = useCartContext();
|
|
2656
|
+
const { trigger: updateCartDeliveryOptions2, isMutating } = useUpdateCartDeliveryOptions(
|
|
2657
|
+
mutate,
|
|
2658
|
+
metafieldIdentifiers
|
|
2659
|
+
);
|
|
2660
|
+
const handler = useCallback(
|
|
2661
|
+
async (_, { arg }) => {
|
|
2662
|
+
const { deliveryData } = arg;
|
|
2663
|
+
const firstDeliveryGroup = cart?.deliveryGroups?.[0];
|
|
2664
|
+
const deliveryGroupId = firstDeliveryGroup?.id;
|
|
2665
|
+
const selectedOptionCode = deliveryData?.deliveryCustomData?.selected_delivery_option?.code;
|
|
2666
|
+
if (!deliveryGroupId || !selectedOptionCode || selectedOptionCode === firstDeliveryGroup?.selectedDeliveryOption?.code) {
|
|
2667
|
+
return null;
|
|
2668
|
+
}
|
|
2669
|
+
const deliveryGroup = cart?.deliveryGroups?.find((group) => group?.id === deliveryGroupId);
|
|
2670
|
+
const matchedOption = deliveryGroup?.deliveryOptions?.find(
|
|
2671
|
+
(option) => option?.code === selectedOptionCode
|
|
2672
|
+
);
|
|
2673
|
+
if (!matchedOption?.handle) {
|
|
2674
|
+
return null;
|
|
2675
|
+
}
|
|
2676
|
+
const deliveryOptions = [
|
|
2677
|
+
{
|
|
2678
|
+
deliveryGroupId,
|
|
2679
|
+
deliveryOptionHandle: matchedOption.handle
|
|
2680
|
+
}
|
|
2681
|
+
];
|
|
2682
|
+
const updatedCart = await updateCartDeliveryOptions2({
|
|
2683
|
+
selectedDeliveryOptions: deliveryOptions
|
|
2684
|
+
});
|
|
2685
|
+
if (updatedCart && mutate) {
|
|
2686
|
+
mutate(updatedCart);
|
|
2687
|
+
}
|
|
2688
|
+
return updatedCart;
|
|
2689
|
+
},
|
|
2690
|
+
[cart, updateCartDeliveryOptions2, mutate]
|
|
2691
|
+
);
|
|
2692
|
+
return useSWRMutation("update-cart-delivery-options", handler, options);
|
|
2693
|
+
};
|
|
2466
2694
|
var usePlusMemberItemCustomAttributes = ({
|
|
2467
2695
|
deliveryData
|
|
2468
2696
|
}) => {
|
|
@@ -2549,15 +2777,14 @@ var usePlusMemberCheckoutCustomAttributes = ({
|
|
|
2549
2777
|
}, [deliveryCustomData, product, profile, userType, variant, isShowShippingBenefits]);
|
|
2550
2778
|
};
|
|
2551
2779
|
function useAutoRemovePlusMemberInCart({
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2780
|
+
cart,
|
|
2781
|
+
profile,
|
|
2782
|
+
memberSetting
|
|
2555
2783
|
}) {
|
|
2556
|
-
const { plus_monthly_product, plus_annual_product } =
|
|
2557
|
-
const { cart } = useCartContext();
|
|
2784
|
+
const { plus_monthly_product, plus_annual_product } = memberSetting || {};
|
|
2558
2785
|
const { trigger: removeCartLines2 } = useRemoveCartLines();
|
|
2559
2786
|
useEffect(() => {
|
|
2560
|
-
if (!cart) return;
|
|
2787
|
+
if (!cart || !plus_monthly_product || !plus_annual_product) return;
|
|
2561
2788
|
const removePlusProduct = async (productType) => {
|
|
2562
2789
|
if (!productType) return;
|
|
2563
2790
|
const product = cart.lineItems?.find(
|
|
@@ -2569,26 +2796,53 @@ function useAutoRemovePlusMemberInCart({
|
|
|
2569
2796
|
});
|
|
2570
2797
|
}
|
|
2571
2798
|
};
|
|
2572
|
-
if (isMonthlyPlus) {
|
|
2799
|
+
if (profile?.isMonthlyPlus) {
|
|
2573
2800
|
removePlusProduct(plus_monthly_product);
|
|
2574
2801
|
}
|
|
2575
|
-
if (isAnnualPlus) {
|
|
2802
|
+
if (profile?.isAnnualPlus) {
|
|
2576
2803
|
removePlusProduct(plus_annual_product);
|
|
2577
2804
|
}
|
|
2805
|
+
}, [cart, plus_annual_product, plus_monthly_product, profile, removeCartLines2]);
|
|
2806
|
+
}
|
|
2807
|
+
function useAddPlusMemberProductsToCart({
|
|
2808
|
+
cart,
|
|
2809
|
+
profile
|
|
2810
|
+
}) {
|
|
2811
|
+
const { selectedPlusMemberMode, selectedPlusMemberProduct, plusMemberMetafields } = usePlusMemberContext();
|
|
2812
|
+
const { hasMonthlyPlus, hasAnnualPlus } = useHasPlusMemberInCart({
|
|
2813
|
+
memberSetting: plusMemberMetafields,
|
|
2814
|
+
cart
|
|
2815
|
+
});
|
|
2816
|
+
const plusMemberProduct = useMemo(() => {
|
|
2817
|
+
if (!selectedPlusMemberProduct || selectedPlusMemberMode === "free" /* FREE */) {
|
|
2818
|
+
return void 0;
|
|
2819
|
+
}
|
|
2820
|
+
if (selectedPlusMemberMode === "monthly" /* MONTHLY */ && hasMonthlyPlus) {
|
|
2821
|
+
return void 0;
|
|
2822
|
+
}
|
|
2823
|
+
if (selectedPlusMemberMode === "annual" /* ANNUAL */ && hasAnnualPlus) {
|
|
2824
|
+
return void 0;
|
|
2825
|
+
}
|
|
2826
|
+
if (profile?.isMonthlyPlus && selectedPlusMemberMode === "monthly" /* MONTHLY */) {
|
|
2827
|
+
return void 0;
|
|
2828
|
+
}
|
|
2829
|
+
if (!profile?.isAnnualPlus && selectedPlusMemberMode === "annual" /* ANNUAL */) {
|
|
2830
|
+
return void 0;
|
|
2831
|
+
}
|
|
2832
|
+
return selectedPlusMemberProduct;
|
|
2578
2833
|
}, [
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
removeCartLines2
|
|
2834
|
+
selectedPlusMemberMode,
|
|
2835
|
+
selectedPlusMemberProduct?.variant,
|
|
2836
|
+
selectedPlusMemberProduct?.product,
|
|
2837
|
+
hasMonthlyPlus,
|
|
2838
|
+
hasAnnualPlus
|
|
2585
2839
|
]);
|
|
2840
|
+
return plusMemberProduct;
|
|
2586
2841
|
}
|
|
2587
2842
|
var PlusMemberProvider = ({
|
|
2588
2843
|
variant,
|
|
2589
2844
|
product,
|
|
2590
|
-
|
|
2591
|
-
metafields,
|
|
2845
|
+
memberSetting,
|
|
2592
2846
|
initialSelectedPlusMemberMode = "free",
|
|
2593
2847
|
profile,
|
|
2594
2848
|
locale,
|
|
@@ -2608,14 +2862,14 @@ var PlusMemberProvider = ({
|
|
|
2608
2862
|
const [deleteMarginBottom, setDeleteMarginBottom] = useState(false);
|
|
2609
2863
|
const shippingMethodsContext = useShippingMethods({
|
|
2610
2864
|
variant,
|
|
2611
|
-
plusMemberMetafields:
|
|
2865
|
+
plusMemberMetafields: memberSetting,
|
|
2612
2866
|
selectedPlusMemberMode});
|
|
2613
2867
|
const plusMemberHandles = useMemo(() => {
|
|
2614
2868
|
return [
|
|
2615
|
-
|
|
2616
|
-
|
|
2869
|
+
memberSetting?.plus_monthly_product?.handle,
|
|
2870
|
+
memberSetting?.plus_annual_product?.handle
|
|
2617
2871
|
].filter(Boolean);
|
|
2618
|
-
}, [
|
|
2872
|
+
}, [memberSetting]);
|
|
2619
2873
|
const { data: plusMemberProducts = [] } = useProductsByHandles({
|
|
2620
2874
|
handles: plusMemberHandles
|
|
2621
2875
|
});
|
|
@@ -2623,25 +2877,24 @@ var PlusMemberProvider = ({
|
|
|
2623
2877
|
if (selectedPlusMemberMode === "free" /* FREE */) {
|
|
2624
2878
|
return null;
|
|
2625
2879
|
}
|
|
2626
|
-
const handle = selectedPlusMemberMode === "monthly" /* MONTHLY */ ?
|
|
2627
|
-
const sku = selectedPlusMemberMode === "monthly" /* MONTHLY */ ?
|
|
2880
|
+
const handle = selectedPlusMemberMode === "monthly" /* MONTHLY */ ? memberSetting?.plus_monthly_product?.handle : memberSetting?.plus_annual_product?.handle;
|
|
2881
|
+
const sku = selectedPlusMemberMode === "monthly" /* MONTHLY */ ? memberSetting?.plus_monthly_product?.sku : memberSetting?.plus_annual_product?.sku;
|
|
2628
2882
|
const product2 = plusMemberProducts?.find((p) => p.handle === handle);
|
|
2629
2883
|
const variant2 = product2?.variants?.find((v) => v.sku === sku);
|
|
2630
2884
|
return product2 && variant2 ? { product: product2, variant: variant2 } : null;
|
|
2631
|
-
}, [plusMemberProducts,
|
|
2885
|
+
}, [plusMemberProducts, memberSetting, selectedPlusMemberMode]);
|
|
2632
2886
|
return /* @__PURE__ */ jsx(
|
|
2633
2887
|
PlusMemberContext.Provider,
|
|
2634
2888
|
{
|
|
2635
2889
|
value: {
|
|
2636
2890
|
variant,
|
|
2637
|
-
shopCommon,
|
|
2638
2891
|
zipCode,
|
|
2639
2892
|
setZipCode,
|
|
2640
2893
|
allowNextDayDelivery,
|
|
2641
2894
|
setAllowNextDayDelivery,
|
|
2642
2895
|
allowThirdDayDelivery,
|
|
2643
2896
|
setAllowThirdDayDelivery,
|
|
2644
|
-
plusMemberMetafields:
|
|
2897
|
+
plusMemberMetafields: memberSetting,
|
|
2645
2898
|
selectedPlusMemberMode,
|
|
2646
2899
|
setSelectedPlusMemberMode,
|
|
2647
2900
|
showAreaCheckModal,
|
|
@@ -2860,6 +3113,9 @@ function CartProvider({
|
|
|
2860
3113
|
}) {
|
|
2861
3114
|
const { client, cartCookieAdapter } = useShopify();
|
|
2862
3115
|
const [customAttributes, setCustomAttributes] = useState([]);
|
|
3116
|
+
const [customAttributesNeedDelete, setCustomAttributesNeedDelete] = useState(
|
|
3117
|
+
[]
|
|
3118
|
+
);
|
|
2863
3119
|
const [isCodeChanging, setIsCodeChanging] = useState(false);
|
|
2864
3120
|
const [loadingState, setLoadingState] = useState({
|
|
2865
3121
|
editLineQuantityLoading: false,
|
|
@@ -2890,7 +3146,11 @@ function CartProvider({
|
|
|
2890
3146
|
useRequest(
|
|
2891
3147
|
() => {
|
|
2892
3148
|
const newAttributes = [...attributes, ...customAttributes];
|
|
2893
|
-
const needUpdate = cart && !
|
|
3149
|
+
const needUpdate = cart && !checkAttributesUpdateNeeded(
|
|
3150
|
+
cart.customAttributes,
|
|
3151
|
+
newAttributes,
|
|
3152
|
+
customAttributesNeedDelete
|
|
3153
|
+
);
|
|
2894
3154
|
if (needUpdate) {
|
|
2895
3155
|
return updateAttributes({ attributes: newAttributes });
|
|
2896
3156
|
} else {
|
|
@@ -2911,11 +3171,12 @@ function CartProvider({
|
|
|
2911
3171
|
isCartLoading: isCartLoading || isCodeChanging,
|
|
2912
3172
|
setLoadingState
|
|
2913
3173
|
});
|
|
2914
|
-
const removeCustomAttributes = useCallback(
|
|
2915
|
-
|
|
2916
|
-
(
|
|
2917
|
-
|
|
2918
|
-
|
|
3174
|
+
const removeCustomAttributes = useCallback(
|
|
3175
|
+
(attributes2) => {
|
|
3176
|
+
setCustomAttributesNeedDelete(attributes2);
|
|
3177
|
+
},
|
|
3178
|
+
[setCustomAttributesNeedDelete]
|
|
3179
|
+
);
|
|
2919
3180
|
const addCustomAttributes = useCallback(
|
|
2920
3181
|
(attributes2) => {
|
|
2921
3182
|
const sameAttributes = attributes2.filter(
|
|
@@ -3002,6 +3263,7 @@ function CartProvider({
|
|
|
3002
3263
|
isCodeChanging,
|
|
3003
3264
|
setIsCodeChanging,
|
|
3004
3265
|
autoFreeGiftConfig,
|
|
3266
|
+
gradientGiftsConfig,
|
|
3005
3267
|
setLoadingState,
|
|
3006
3268
|
loadingState,
|
|
3007
3269
|
// function满赠
|
|
@@ -3025,6 +3287,7 @@ function CartProvider({
|
|
|
3025
3287
|
locale,
|
|
3026
3288
|
isCodeChanging,
|
|
3027
3289
|
autoFreeGiftConfig,
|
|
3290
|
+
gradientGiftsConfig,
|
|
3028
3291
|
loadingState,
|
|
3029
3292
|
// function满赠
|
|
3030
3293
|
functionAutoFreeGift,
|
|
@@ -3048,6 +3311,6 @@ function useCartContext() {
|
|
|
3048
3311
|
return context;
|
|
3049
3312
|
}
|
|
3050
3313
|
|
|
3051
|
-
export { BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, CartProvider, DeliveryPlusType, MAIN_PRODUCT_CODE, OrderBasePriceType, OrderDiscountType, PLUS_MEMBER_TYPE, PlusMemberContext, PlusMemberMode, PlusMemberProvider, PriceBasePriceType, PriceDiscountType, RuleType, SCRIPT_CODE_AMOUNT_KEY, ShippingMethodMode, ShopifyContext, ShopifyProvider, SpendMoneyType, atobID, browserCartCookieAdapter, browserCookieAdapter, btoaID, clearGeoLocationCache, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, gaTrack, getCachedGeoLocation, getDiscountEnvAttributeValue, getMatchedMainProductSubTotal, getQuery, getReferralAttributes,
|
|
3314
|
+
export { BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, CartProvider, DeliveryPlusType, MAIN_PRODUCT_CODE, OrderBasePriceType, OrderDiscountType, PLUS_MEMBER_TYPE, PlusMemberContext, PlusMemberMode, PlusMemberProvider, PriceBasePriceType, PriceDiscountType, RuleType, SCRIPT_CODE_AMOUNT_KEY, ShippingMethodMode, ShopifyContext, ShopifyProvider, SpendMoneyType, atobID, browserCartCookieAdapter, browserCookieAdapter, btoaID, checkAttributesUpdateNeeded, clearGeoLocationCache, createMockCartFromLines, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, gaTrack, getCachedGeoLocation, getDiscountEnvAttributeValue, getMatchedMainProductSubTotal, getQuery, getReferralAttributes, normalizeAddToCartLines, preCheck, safeParse, trackAddToCartFBQ, trackAddToCartGA, trackBeginCheckoutGA, trackBuyNowFBQ, trackBuyNowGA, useAddCartLines, useAddPlusMemberProductsToCart, useAddToCart, useAllBlogs, useAllCollections, useAllProducts, useApplyCartCodes, useArticle, useArticles, useArticlesInBlog, useAutoRemovePlusMemberInCart, useBlog, useBuyNow, useCalcAutoFreeGift, useCalcGiftsFromLines, useCalcOrderDiscount, useCartAttributes, useCartContext, useCartItemQuantityLimit, useCollection, useCollections, useCreateCart, useExposure, useGeoLocation, useHasPlusMemberInCart, useIntersection, usePlusAnnualProductVariant, usePlusMemberCheckoutCustomAttributes, usePlusMemberContext, usePlusMemberDeliveryCodes, usePlusMemberItemCustomAttributes, usePlusMonthlyProductVariant, usePrice, useProduct, useProductUrl, useProductsByHandles, useRemoveCartCodes, useRemoveCartLines, useReplaceCartPlusMember, useScriptAutoFreeGift, useSearch, useSelectedOptions, useShippingMethodAvailableCheck, useShippingMethods, useShopify, useSite, useUpdateCartAttributes, useUpdateCartLines, useUpdateLineCodeAmountAttributes, useUpdatePlusMemberDeliveryOptions, useUpdateVariantQuery, useVariant, useVariantMedia };
|
|
3052
3315
|
//# sourceMappingURL=index.mjs.map
|
|
3053
3316
|
//# sourceMappingURL=index.mjs.map
|