@pisell/pisellos 0.0.160 → 0.0.161
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.
|
@@ -10,6 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
12
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
+
import Decimal from "decimal.js";
|
|
13
14
|
export function updateAllCartItemPrice(_x, _x2, _x3, _x4) {
|
|
14
15
|
return _updateAllCartItemPrice.apply(this, arguments);
|
|
15
16
|
}
|
|
@@ -49,6 +50,9 @@ function _updateAllCartItemPrice() {
|
|
|
49
50
|
var targetBundleItem = targetBundle.bundle_item.find(function (m) {
|
|
50
51
|
return m.id === n.id;
|
|
51
52
|
});
|
|
53
|
+
if (targetBundleItem.price_type === 'markdown') {
|
|
54
|
+
targetBundleItem.price = new Decimal(targetBundleItem.price || 0).mul(-1).toNumber();
|
|
55
|
+
}
|
|
52
56
|
if (targetBundleItem) {
|
|
53
57
|
return _objectSpread(_objectSpread({}, n), {}, {
|
|
54
58
|
price: targetBundleItem.price,
|
|
@@ -232,7 +232,7 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
232
232
|
cacheId: this.cacheId,
|
|
233
233
|
fatherModule: this.fatherModule,
|
|
234
234
|
store: store,
|
|
235
|
-
cacheKey: ['scheduleList', 'availabilityDateList']
|
|
235
|
+
cacheKey: ['scheduleList', 'availabilityDateList', 'otherProductsIds']
|
|
236
236
|
});
|
|
237
237
|
}
|
|
238
238
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// src/modules/Cart/utils/changePrice.ts
|
|
@@ -22,6 +32,7 @@ __export(changePrice_exports, {
|
|
|
22
32
|
updateAllCartItemPrice: () => updateAllCartItemPrice
|
|
23
33
|
});
|
|
24
34
|
module.exports = __toCommonJS(changePrice_exports);
|
|
35
|
+
var import_decimal = __toESM(require("decimal.js"));
|
|
25
36
|
async function updateAllCartItemPrice(cartItems, priceData, getProduct, updateCart) {
|
|
26
37
|
for (const item of cartItems) {
|
|
27
38
|
const targetProduct = priceData.find((n) => n.id === item.id);
|
|
@@ -41,6 +52,9 @@ async function updateAllCartItemPrice(cartItems, priceData, getProduct, updateCa
|
|
|
41
52
|
const targetBundleItem = targetBundle.bundle_item.find(
|
|
42
53
|
(m) => m.id === n.id
|
|
43
54
|
);
|
|
55
|
+
if (targetBundleItem.price_type === "markdown") {
|
|
56
|
+
targetBundleItem.price = new import_decimal.default(targetBundleItem.price || 0).mul(-1).toNumber();
|
|
57
|
+
}
|
|
44
58
|
if (targetBundleItem) {
|
|
45
59
|
return {
|
|
46
60
|
...n,
|
|
@@ -154,7 +154,7 @@ var ScheduleModule = class extends import_BaseModule.BaseModule {
|
|
|
154
154
|
cacheId: this.cacheId,
|
|
155
155
|
fatherModule: this.fatherModule,
|
|
156
156
|
store,
|
|
157
|
-
cacheKey: ["scheduleList", "availabilityDateList"]
|
|
157
|
+
cacheKey: ["scheduleList", "availabilityDateList", "otherProductsIds"]
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
}
|