@anker-in/shopify-react 0.1.1-beta.33 → 0.1.1-beta.34
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 -4
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +4 -4
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.js +1 -1
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +1 -1
- package/dist/provider/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -167,7 +167,7 @@ function normalizeAddToCartLines(lines) {
|
|
|
167
167
|
const product = variant.product;
|
|
168
168
|
const quantity = line.quantity || 1;
|
|
169
169
|
const originalPrice = variant.price?.amount ? Number(variant.price.amount) : 0;
|
|
170
|
-
const finalPrice = variant.finalPrice?.amount ? Number(variant.finalPrice
|
|
170
|
+
const finalPrice = variant.finalPrice?.amount === void 0 ? originalPrice : Number(variant.finalPrice?.amount);
|
|
171
171
|
const subtotalAmount = originalPrice * quantity;
|
|
172
172
|
const totalAmount = finalPrice * quantity;
|
|
173
173
|
return {
|
|
@@ -826,7 +826,7 @@ var trackAddToCartGA = ({
|
|
|
826
826
|
const currencyCode = variant.product?.price?.currencyCode;
|
|
827
827
|
const totalPrice = lineItems?.reduce(
|
|
828
828
|
(prev, { variant: variant2 }) => prev.plus(
|
|
829
|
-
variant2?.finalPrice?.amount
|
|
829
|
+
variant2?.finalPrice?.amount === void 0 ? Number(variant2?.price?.amount) || 0 : Number(variant2?.finalPrice?.amount) || 0
|
|
830
830
|
),
|
|
831
831
|
new Decimal2__default.default(0)
|
|
832
832
|
).toNumber();
|
|
@@ -861,7 +861,7 @@ var trackBeginCheckoutGA = ({
|
|
|
861
861
|
}
|
|
862
862
|
const totalPrice = lineItems?.reduce(
|
|
863
863
|
(prev, { variant }) => prev.plus(
|
|
864
|
-
variant?.finalPrice?.amount
|
|
864
|
+
variant?.finalPrice?.amount === void 0 ? Number(variant?.price?.amount) || 0 : Number(variant?.finalPrice?.amount) || 0
|
|
865
865
|
),
|
|
866
866
|
new Decimal2__default.default(0)
|
|
867
867
|
).toNumber();
|
|
@@ -897,7 +897,7 @@ var trackBuyNowGA = ({
|
|
|
897
897
|
const currencyCode = variant.product?.price?.currencyCode || variant.price?.currencyCode;
|
|
898
898
|
const totalPrice = lineItems?.reduce(
|
|
899
899
|
(prev, { variant: variant2 }) => prev.plus(
|
|
900
|
-
variant2?.finalPrice?.amount
|
|
900
|
+
variant2?.finalPrice?.amount === void 0 ? Number(variant2?.price?.amount) || 0 : Number(variant2?.finalPrice?.amount) || 0
|
|
901
901
|
),
|
|
902
902
|
new Decimal2__default.default(0)
|
|
903
903
|
).toNumber();
|
|
@@ -1070,7 +1070,7 @@ var getLinesWithFunctionAttributes = (lineItems) => {
|
|
|
1070
1070
|
key: CUSTOMER_ATTRIBUTE_KEY,
|
|
1071
1071
|
value: JSON.stringify({
|
|
1072
1072
|
is_gift: false,
|
|
1073
|
-
discounted_amount: Number(line.variant?.
|
|
1073
|
+
discounted_amount: line.variant?.finalPrice?.amount === void 0 ? Number(line.variant?.price?.amount) * (line.quantity || 1) : Number(line.variant?.finalPrice?.amount) * (line.quantity || 1)
|
|
1074
1074
|
})
|
|
1075
1075
|
}
|
|
1076
1076
|
]);
|