@azzas/azzas-tracker-web 2.0.0-preview.17 → 2.0.0-preview.18
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 +6 -10
- package/dist/mod.cjs.map +1 -1
- package/dist/mod.global.js +6 -10
- package/dist/mod.global.js.map +1 -1
- package/dist/mod.js +6 -10
- package/dist/mod.js.map +1 -1
- package/dist/mod.vtex.global.js +7 -11
- package/package.json +1 -1
package/dist/mod.js
CHANGED
|
@@ -1842,7 +1842,7 @@ var orderFormAdapter = {
|
|
|
1842
1842
|
index: (_c = (_b = context == null ? void 0 : context.orderForm) == null ? void 0 : _b.index) != null ? _c : index + 1,
|
|
1843
1843
|
item_brand: (_e = (_d = item.additionalInfo) == null ? void 0 : _d.brandName) != null ? _e : null,
|
|
1844
1844
|
item_name: (_f = item == null ? void 0 : item.name.replace(item == null ? void 0 : item.skuName, "").trim()) != null ? _f : null,
|
|
1845
|
-
price: (item == null ? void 0 : item.
|
|
1845
|
+
price: (item == null ? void 0 : item.sellingPrice) / 100,
|
|
1846
1846
|
discount: ((item == null ? void 0 : item.listPrice) - (item == null ? void 0 : item.sellingPrice)) / 100,
|
|
1847
1847
|
item_variant: (_j = (_i = (_h = (_g = item == null ? void 0 : item.skuName) == null ? void 0 : _g.split(" - ")[0]) == null ? void 0 : _h.split("_").pop()) == null ? void 0 : _i.trim()) != null ? _j : null,
|
|
1848
1848
|
item_variant2: (_m = (_l = (_k = item == null ? void 0 : item.skuName) == null ? void 0 : _k.split(" - ")[1]) == null ? void 0 : _l.trim()) != null ? _m : null,
|
|
@@ -1879,20 +1879,16 @@ var orderFormAdapter = {
|
|
|
1879
1879
|
var _a;
|
|
1880
1880
|
if (context == null ? void 0 : context.value) return context.value;
|
|
1881
1881
|
if (!((_a = context == null ? void 0 : context.orderForm) == null ? void 0 : _a.items)) return null;
|
|
1882
|
-
return getOrderFormItems(context.orderForm).map((item) => (item == null ? void 0 : item.
|
|
1882
|
+
return getOrderFormItems(context.orderForm).map((item) => (item == null ? void 0 : item.sellingPrice) / 100 * item.quantity).filter((price) => price !== void 0).reduce((sum, price) => sum + price, 0);
|
|
1883
1883
|
},
|
|
1884
1884
|
payment_type: getPaymentType2,
|
|
1885
1885
|
total_discount: (context) => {
|
|
1886
|
-
var _a, _b;
|
|
1886
|
+
var _a, _b, _c;
|
|
1887
1887
|
if (context == null ? void 0 : context.total_discount) return context.total_discount;
|
|
1888
1888
|
if (!((_a = context == null ? void 0 : context.orderForm) == null ? void 0 : _a.items)) return null;
|
|
1889
|
-
const
|
|
1890
|
-
const
|
|
1891
|
-
|
|
1892
|
-
return acc + unitDiscount * item.quantity;
|
|
1893
|
-
}, 0);
|
|
1894
|
-
const discounts = totalsList.find((t) => t.id === "Discounts");
|
|
1895
|
-
return Math.abs(((discounts == null ? void 0 : discounts.value) || 0) + totalDiscount) / 100 || null;
|
|
1889
|
+
const totalizers = (_b = context == null ? void 0 : context.orderForm) == null ? void 0 : _b.totalizers;
|
|
1890
|
+
const productDiscount = ((_c = totalizers.find((t) => t.id === "Discounts")) == null ? void 0 : _c.value) || 0;
|
|
1891
|
+
return Math.abs(productDiscount) / 100 || null;
|
|
1896
1892
|
},
|
|
1897
1893
|
subtotal: (context) => {
|
|
1898
1894
|
var _a, _b;
|