@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.cjs
CHANGED
|
@@ -1871,7 +1871,7 @@ var orderFormAdapter = {
|
|
|
1871
1871
|
index: (_c = (_b = context == null ? void 0 : context.orderForm) == null ? void 0 : _b.index) != null ? _c : index + 1,
|
|
1872
1872
|
item_brand: (_e = (_d = item.additionalInfo) == null ? void 0 : _d.brandName) != null ? _e : null,
|
|
1873
1873
|
item_name: (_f = item == null ? void 0 : item.name.replace(item == null ? void 0 : item.skuName, "").trim()) != null ? _f : null,
|
|
1874
|
-
price: (item == null ? void 0 : item.
|
|
1874
|
+
price: (item == null ? void 0 : item.sellingPrice) / 100,
|
|
1875
1875
|
discount: ((item == null ? void 0 : item.listPrice) - (item == null ? void 0 : item.sellingPrice)) / 100,
|
|
1876
1876
|
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,
|
|
1877
1877
|
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,
|
|
@@ -1908,20 +1908,16 @@ var orderFormAdapter = {
|
|
|
1908
1908
|
var _a;
|
|
1909
1909
|
if (context == null ? void 0 : context.value) return context.value;
|
|
1910
1910
|
if (!((_a = context == null ? void 0 : context.orderForm) == null ? void 0 : _a.items)) return null;
|
|
1911
|
-
return getOrderFormItems(context.orderForm).map((item) => (item == null ? void 0 : item.
|
|
1911
|
+
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);
|
|
1912
1912
|
},
|
|
1913
1913
|
payment_type: getPaymentType2,
|
|
1914
1914
|
total_discount: (context) => {
|
|
1915
|
-
var _a, _b;
|
|
1915
|
+
var _a, _b, _c;
|
|
1916
1916
|
if (context == null ? void 0 : context.total_discount) return context.total_discount;
|
|
1917
1917
|
if (!((_a = context == null ? void 0 : context.orderForm) == null ? void 0 : _a.items)) return null;
|
|
1918
|
-
const
|
|
1919
|
-
const
|
|
1920
|
-
|
|
1921
|
-
return acc + unitDiscount * item.quantity;
|
|
1922
|
-
}, 0);
|
|
1923
|
-
const discounts = totalsList.find((t) => t.id === "Discounts");
|
|
1924
|
-
return Math.abs(((discounts == null ? void 0 : discounts.value) || 0) + totalDiscount) / 100 || null;
|
|
1918
|
+
const totalizers = (_b = context == null ? void 0 : context.orderForm) == null ? void 0 : _b.totalizers;
|
|
1919
|
+
const productDiscount = ((_c = totalizers.find((t) => t.id === "Discounts")) == null ? void 0 : _c.value) || 0;
|
|
1920
|
+
return Math.abs(productDiscount) / 100 || null;
|
|
1925
1921
|
},
|
|
1926
1922
|
subtotal: (context) => {
|
|
1927
1923
|
var _a, _b;
|