@betterstore/react 0.3.18 → 0.3.20
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/CHANGELOG.md +12 -0
- package/dist/index.cjs.js +5 -5
- package/dist/index.mjs +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -94,10 +94,7 @@ function createJSONStorage(getStorage, options) {
|
|
|
94
94
|
}
|
|
95
95
|
return parse(str);
|
|
96
96
|
},
|
|
97
|
-
setItem: (name, newValue) => storage.setItem(
|
|
98
|
-
name,
|
|
99
|
-
JSON.stringify(newValue, void 0 )
|
|
100
|
-
),
|
|
97
|
+
setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, void 0 )),
|
|
101
98
|
removeItem: (name) => storage.removeItem(name)
|
|
102
99
|
};
|
|
103
100
|
return persistStorage;
|
|
@@ -35057,7 +35054,7 @@ function DiscountCode({ applyDiscountCode, revalidateDiscounts, }) {
|
|
|
35057
35054
|
setIsLoading(true);
|
|
35058
35055
|
try {
|
|
35059
35056
|
yield applyDiscountCode(discountCode);
|
|
35060
|
-
|
|
35057
|
+
// await revalidateDiscounts();
|
|
35061
35058
|
setDiscountCode("");
|
|
35062
35059
|
toast.success(t("CheckoutEmbed.Summary.discountCodeSuccess"));
|
|
35063
35060
|
}
|
|
@@ -35176,6 +35173,9 @@ function CheckoutSummary({ appliedDiscounts, lineItems, shipping, tax, currency,
|
|
|
35176
35173
|
const percentage = discount.discount.value / 100;
|
|
35177
35174
|
return elegibleTotalAmount * percentage;
|
|
35178
35175
|
}
|
|
35176
|
+
else if (discount.discount.valueType === "FREE") {
|
|
35177
|
+
return elegibleTotalAmount;
|
|
35178
|
+
}
|
|
35179
35179
|
return elegibleQuantity * discount.discount.value;
|
|
35180
35180
|
});
|
|
35181
35181
|
const totalDiscountAmount = formattedProductAppliedDiscounts.length > 0
|
package/dist/index.mjs
CHANGED
|
@@ -71,10 +71,7 @@ function createJSONStorage(getStorage, options) {
|
|
|
71
71
|
}
|
|
72
72
|
return parse(str);
|
|
73
73
|
},
|
|
74
|
-
setItem: (name, newValue) => storage.setItem(
|
|
75
|
-
name,
|
|
76
|
-
JSON.stringify(newValue, void 0 )
|
|
77
|
-
),
|
|
74
|
+
setItem: (name, newValue) => storage.setItem(name, JSON.stringify(newValue, void 0 )),
|
|
78
75
|
removeItem: (name) => storage.removeItem(name)
|
|
79
76
|
};
|
|
80
77
|
return persistStorage;
|
|
@@ -35034,7 +35031,7 @@ function DiscountCode({ applyDiscountCode, revalidateDiscounts, }) {
|
|
|
35034
35031
|
setIsLoading(true);
|
|
35035
35032
|
try {
|
|
35036
35033
|
yield applyDiscountCode(discountCode);
|
|
35037
|
-
|
|
35034
|
+
// await revalidateDiscounts();
|
|
35038
35035
|
setDiscountCode("");
|
|
35039
35036
|
toast.success(t("CheckoutEmbed.Summary.discountCodeSuccess"));
|
|
35040
35037
|
}
|
|
@@ -35153,6 +35150,9 @@ function CheckoutSummary({ appliedDiscounts, lineItems, shipping, tax, currency,
|
|
|
35153
35150
|
const percentage = discount.discount.value / 100;
|
|
35154
35151
|
return elegibleTotalAmount * percentage;
|
|
35155
35152
|
}
|
|
35153
|
+
else if (discount.discount.valueType === "FREE") {
|
|
35154
|
+
return elegibleTotalAmount;
|
|
35155
|
+
}
|
|
35156
35156
|
return elegibleQuantity * discount.discount.value;
|
|
35157
35157
|
});
|
|
35158
35158
|
const totalDiscountAmount = formattedProductAppliedDiscounts.length > 0
|