@azzas/azzas-tracker-web 2.0.0 → 2.0.1-preview.0
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/mod.cjs +7 -4
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.global.js +7 -4
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +7 -4
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +13 -7
- package/package.json +1 -1
package/dist/mod.cjs
CHANGED
|
@@ -2022,10 +2022,13 @@ var orderFormAdapter = {
|
|
|
2022
2022
|
total_discount: (context) => {
|
|
2023
2023
|
var _a, _b, _c;
|
|
2024
2024
|
if (context == null ? void 0 : context.total_discount) return context.total_discount;
|
|
2025
|
-
|
|
2026
|
-
const
|
|
2027
|
-
|
|
2028
|
-
|
|
2025
|
+
const orderForm = context == null ? void 0 : context.orderForm;
|
|
2026
|
+
const items = orderForm == null ? void 0 : orderForm.items;
|
|
2027
|
+
if (!(items == null ? void 0 : items.length) || typeof (orderForm == null ? void 0 : orderForm.value) !== "number") return null;
|
|
2028
|
+
const itemsFullValue = items.reduce((acc, item) => acc + item.listPrice * item.quantity, 0);
|
|
2029
|
+
const shipping = (_c = (_b = (_a = orderForm == null ? void 0 : orderForm.totalizers) == null ? void 0 : _a.find((t) => t.id === "Shipping")) == null ? void 0 : _b.value) != null ? _c : 0;
|
|
2030
|
+
const derived = itemsFullValue + shipping - orderForm.value;
|
|
2031
|
+
return derived > 0 ? derived / 100 : null;
|
|
2029
2032
|
},
|
|
2030
2033
|
subtotal: (context) => {
|
|
2031
2034
|
var _a, _b;
|