@anker-in/shopify-react 0.1.1-beta.24 → 0.1.1-beta.25
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.js +4 -2
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +4 -2
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.js +4 -2
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +4 -2
- package/dist/provider/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/hooks/index.mjs
CHANGED
|
@@ -86,7 +86,7 @@ function normalizeAddToCartLines(lines) {
|
|
|
86
86
|
customAttributes: line.attributes || [],
|
|
87
87
|
variant: {
|
|
88
88
|
id: variant.id,
|
|
89
|
-
price:
|
|
89
|
+
price: finalPrice,
|
|
90
90
|
listPrice: variant.compareAtPrice?.amount ? Number(variant.compareAtPrice.amount) : 0,
|
|
91
91
|
sku: variant.sku || "",
|
|
92
92
|
name: variant.title || "",
|
|
@@ -117,7 +117,7 @@ function createMockCartFromLines(lines, existingCart) {
|
|
|
117
117
|
const normalizedLines = normalizeAddToCartLines(lines);
|
|
118
118
|
const subtotalPrice = normalizedLines.reduce((sum, line) => sum + line.subtotalAmount, 0);
|
|
119
119
|
const totalPrice = normalizedLines.reduce((sum, line) => sum + line.totalAmount, 0);
|
|
120
|
-
console.log("lines
|
|
120
|
+
console.log("lines createMockCartFromLines4444", normalizedLines, lines);
|
|
121
121
|
const currency = lines[0]?.variant?.price?.currencyCode;
|
|
122
122
|
return {
|
|
123
123
|
id: existingCart?.id || "temp-cart-id",
|
|
@@ -367,6 +367,7 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer, lines) => {
|
|
|
367
367
|
}
|
|
368
368
|
return cart;
|
|
369
369
|
}, [lines, cart]);
|
|
370
|
+
console.log("effectiveCart useCalcAutoFreeGift", effectiveCart);
|
|
370
371
|
const { activeCampaign, subtotal } = useMemo(() => {
|
|
371
372
|
for (const campaign of autoFreeGiftConfig) {
|
|
372
373
|
const { rule_conditions = [], rule_result } = campaign;
|
|
@@ -382,6 +383,7 @@ var useCalcAutoFreeGift = (cart, autoFreeGiftConfig, customer, lines) => {
|
|
|
382
383
|
all_store_variant: spend_get_reward.main_product?.all_store_variant || false
|
|
383
384
|
}
|
|
384
385
|
);
|
|
386
|
+
console.log("matchedSubtotal useCalcAutoFreeGift", matchedSubtotal);
|
|
385
387
|
if (matchedSubtotal > 0) {
|
|
386
388
|
return { activeCampaign: campaign, subtotal: matchedSubtotal };
|
|
387
389
|
}
|