@ikas/storefront 1.0.3 → 1.0.4
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/build/index.es.js +10 -9
- package/build/index.js +10 -9
- package/package.json +1 -1
package/build/index.es.js
CHANGED
|
@@ -70961,16 +70961,16 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
70961
70961
|
if (initialQuantity === void 0) { initialQuantity = 1; }
|
|
70962
70962
|
return __awaiter(_this, void 0, void 0, function () {
|
|
70963
70963
|
var existingItem, optionValues, cartId, input, cart, eventId, item, err_2;
|
|
70964
|
-
var _a, _b, _c, _d;
|
|
70965
|
-
return __generator(this, function (
|
|
70966
|
-
switch (
|
|
70964
|
+
var _a, _b, _c, _d, _e;
|
|
70965
|
+
return __generator(this, function (_f) {
|
|
70966
|
+
switch (_f.label) {
|
|
70967
70967
|
case 0:
|
|
70968
|
-
|
|
70968
|
+
_f.trys.push([0, 5, , 6]);
|
|
70969
70969
|
if (!product.canAddToCart)
|
|
70970
70970
|
return [2 /*return*/, false];
|
|
70971
70971
|
return [4 /*yield*/, this.beforeCartOperationCheck()];
|
|
70972
70972
|
case 1:
|
|
70973
|
-
|
|
70973
|
+
_f.sent();
|
|
70974
70974
|
if (this.cart) {
|
|
70975
70975
|
existingItem = this.findExistingItem(variant, product);
|
|
70976
70976
|
if (existingItem) {
|
|
@@ -71001,12 +71001,12 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
71001
71001
|
};
|
|
71002
71002
|
return [4 /*yield*/, IkasCartAPI.saveItemToCart(input)];
|
|
71003
71003
|
case 2:
|
|
71004
|
-
cart =
|
|
71004
|
+
cart = _f.sent();
|
|
71005
71005
|
if (!cart) return [3 /*break*/, 4];
|
|
71006
71006
|
return [4 /*yield*/, this.setCart(cart)];
|
|
71007
71007
|
case 3:
|
|
71008
|
-
|
|
71009
|
-
|
|
71008
|
+
_f.sent();
|
|
71009
|
+
_f.label = 4;
|
|
71010
71010
|
case 4:
|
|
71011
71011
|
if (this.cart) {
|
|
71012
71012
|
eventId = this.cart.id + "-" + this.cart.updatedAt;
|
|
@@ -71015,9 +71015,10 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
71015
71015
|
Analytics.addToCart(item, initialQuantity, eventId, this.cart);
|
|
71016
71016
|
}
|
|
71017
71017
|
}
|
|
71018
|
+
(_e = product.productOptionSet) === null || _e === void 0 ? void 0 : _e.initOptionValues();
|
|
71018
71019
|
return [2 /*return*/, true];
|
|
71019
71020
|
case 5:
|
|
71020
|
-
err_2 =
|
|
71021
|
+
err_2 = _f.sent();
|
|
71021
71022
|
console.log(err_2);
|
|
71022
71023
|
return [2 /*return*/, false];
|
|
71023
71024
|
case 6: return [2 /*return*/];
|
package/build/index.js
CHANGED
|
@@ -70938,16 +70938,16 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
70938
70938
|
if (initialQuantity === void 0) { initialQuantity = 1; }
|
|
70939
70939
|
return __awaiter(_this, void 0, void 0, function () {
|
|
70940
70940
|
var existingItem, optionValues, cartId, input, cart, eventId, item, err_2;
|
|
70941
|
-
var _a, _b, _c, _d;
|
|
70942
|
-
return __generator(this, function (
|
|
70943
|
-
switch (
|
|
70941
|
+
var _a, _b, _c, _d, _e;
|
|
70942
|
+
return __generator(this, function (_f) {
|
|
70943
|
+
switch (_f.label) {
|
|
70944
70944
|
case 0:
|
|
70945
|
-
|
|
70945
|
+
_f.trys.push([0, 5, , 6]);
|
|
70946
70946
|
if (!product.canAddToCart)
|
|
70947
70947
|
return [2 /*return*/, false];
|
|
70948
70948
|
return [4 /*yield*/, this.beforeCartOperationCheck()];
|
|
70949
70949
|
case 1:
|
|
70950
|
-
|
|
70950
|
+
_f.sent();
|
|
70951
70951
|
if (this.cart) {
|
|
70952
70952
|
existingItem = this.findExistingItem(variant, product);
|
|
70953
70953
|
if (existingItem) {
|
|
@@ -70978,12 +70978,12 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
70978
70978
|
};
|
|
70979
70979
|
return [4 /*yield*/, IkasCartAPI.saveItemToCart(input)];
|
|
70980
70980
|
case 2:
|
|
70981
|
-
cart =
|
|
70981
|
+
cart = _f.sent();
|
|
70982
70982
|
if (!cart) return [3 /*break*/, 4];
|
|
70983
70983
|
return [4 /*yield*/, this.setCart(cart)];
|
|
70984
70984
|
case 3:
|
|
70985
|
-
|
|
70986
|
-
|
|
70985
|
+
_f.sent();
|
|
70986
|
+
_f.label = 4;
|
|
70987
70987
|
case 4:
|
|
70988
70988
|
if (this.cart) {
|
|
70989
70989
|
eventId = this.cart.id + "-" + this.cart.updatedAt;
|
|
@@ -70992,9 +70992,10 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
70992
70992
|
Analytics.addToCart(item, initialQuantity, eventId, this.cart);
|
|
70993
70993
|
}
|
|
70994
70994
|
}
|
|
70995
|
+
(_e = product.productOptionSet) === null || _e === void 0 ? void 0 : _e.initOptionValues();
|
|
70995
70996
|
return [2 /*return*/, true];
|
|
70996
70997
|
case 5:
|
|
70997
|
-
err_2 =
|
|
70998
|
+
err_2 = _f.sent();
|
|
70998
70999
|
console.log(err_2);
|
|
70999
71000
|
return [2 /*return*/, false];
|
|
71000
71001
|
case 6: return [2 /*return*/];
|