@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.js
CHANGED
|
@@ -1993,10 +1993,13 @@ var orderFormAdapter = {
|
|
|
1993
1993
|
total_discount: (context) => {
|
|
1994
1994
|
var _a, _b, _c;
|
|
1995
1995
|
if (context == null ? void 0 : context.total_discount) return context.total_discount;
|
|
1996
|
-
|
|
1997
|
-
const
|
|
1998
|
-
|
|
1999
|
-
|
|
1996
|
+
const orderForm = context == null ? void 0 : context.orderForm;
|
|
1997
|
+
const items = orderForm == null ? void 0 : orderForm.items;
|
|
1998
|
+
if (!(items == null ? void 0 : items.length) || typeof (orderForm == null ? void 0 : orderForm.value) !== "number") return null;
|
|
1999
|
+
const itemsFullValue = items.reduce((acc, item) => acc + item.listPrice * item.quantity, 0);
|
|
2000
|
+
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;
|
|
2001
|
+
const derived = itemsFullValue + shipping - orderForm.value;
|
|
2002
|
+
return derived > 0 ? derived / 100 : null;
|
|
2000
2003
|
},
|
|
2001
2004
|
subtotal: (context) => {
|
|
2002
2005
|
var _a, _b;
|