ng-easycommerce 0.0.640 → 0.0.642
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/README.md +4 -0
- package/bundles/ng-easycommerce.umd.js +19 -1
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/ec-component/cart-ec/cart-ec.component.js +8 -1
- package/esm2015/lib/ec-component/sidebar-ec/sidebar-ec.component.js +8 -1
- package/esm2015/lib/services/cart.service.js +6 -2
- package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +8 -1
- package/esm5/lib/ec-component/sidebar-ec/sidebar-ec.component.js +8 -1
- package/esm5/lib/services/cart.service.js +6 -2
- package/fesm2015/ng-easycommerce.js +19 -1
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +19 -1
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-component/cart-ec/cart-ec.component.d.ts +1 -0
- package/lib/ec-component/sidebar-ec/sidebar-ec.component.d.ts +1 -0
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/ng-easycommerce.js
CHANGED
|
@@ -4941,7 +4941,11 @@ var CartService = /** @class */ (function () {
|
|
|
4941
4941
|
};
|
|
4942
4942
|
this.updateItemQuantity = function (item, quantity) {
|
|
4943
4943
|
if (_this.validateQuantity(item, quantity) && (_this.validatePriceAndCredits(item, quantity))) {
|
|
4944
|
-
_this.
|
|
4944
|
+
_this.requestInProcess.next(true);
|
|
4945
|
+
_this.connection
|
|
4946
|
+
.put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)), { 'quantity': Number(quantity) })
|
|
4947
|
+
.pipe(finalize(function () { return _this.requestInProcess.next(false); }))
|
|
4948
|
+
.subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity)); }, function (err) { return _this.handleError(err); });
|
|
4945
4949
|
}
|
|
4946
4950
|
};
|
|
4947
4951
|
this.validateQuantity = function (item, quantity) {
|
|
@@ -7497,6 +7501,7 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7497
7501
|
_this.hideTaxes = false;
|
|
7498
7502
|
_this.creditAccountShowPrices = null;
|
|
7499
7503
|
_this.showTaxLegend = false;
|
|
7504
|
+
_this.cartLoading = false;
|
|
7500
7505
|
_this.toDecimal = function (amount) { return _this.consts.toDecimal(amount); };
|
|
7501
7506
|
_this.redirectRegister = function () { return _this.router.navigateByUrl("/auth/login"); };
|
|
7502
7507
|
_this.getVariants = function (product) {
|
|
@@ -7572,11 +7577,17 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7572
7577
|
this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
7573
7578
|
_this.creditAccountShowPrices = showPrice;
|
|
7574
7579
|
});
|
|
7580
|
+
this.cartService.loading.subscribe(function (isLoading) {
|
|
7581
|
+
_this.cartLoading = isLoading;
|
|
7582
|
+
});
|
|
7575
7583
|
this.ecOnInit();
|
|
7576
7584
|
};
|
|
7577
7585
|
CartEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
7578
7586
|
var _this = this;
|
|
7579
7587
|
var _a;
|
|
7588
|
+
if (this.cartLoading) {
|
|
7589
|
+
return;
|
|
7590
|
+
}
|
|
7580
7591
|
var multipleQuantity = ((_a = item.product) === null || _a === void 0 ? void 0 : _a.variants) && item.product.variants.length > 0 ? item.product.variants[0].multipleQuantity : 0;
|
|
7581
7592
|
var step = multipleQuantity && multipleQuantity > 0 ? multipleQuantity : 1;
|
|
7582
7593
|
var newQuantity;
|
|
@@ -19140,6 +19151,7 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19140
19151
|
this.hideTaxes = false;
|
|
19141
19152
|
this.creditAccountShowPrices = null;
|
|
19142
19153
|
this.showTaxLegend = false;
|
|
19154
|
+
this.cartLoading = false;
|
|
19143
19155
|
this.getVariants = function (product) {
|
|
19144
19156
|
var item = product.product;
|
|
19145
19157
|
if (item.variants && item.variants.length && item.variants[0].options && item.variants[0].options.length) {
|
|
@@ -19197,9 +19209,15 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19197
19209
|
this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
19198
19210
|
_this.creditAccountShowPrices = showPrice;
|
|
19199
19211
|
});
|
|
19212
|
+
this.cartService.loading.subscribe(function (isLoading) {
|
|
19213
|
+
_this.cartLoading = isLoading;
|
|
19214
|
+
});
|
|
19200
19215
|
};
|
|
19201
19216
|
SidebarEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
19202
19217
|
var _a;
|
|
19218
|
+
if (this.cartLoading) {
|
|
19219
|
+
return;
|
|
19220
|
+
}
|
|
19203
19221
|
var multipleQuantity = ((_a = item.product) === null || _a === void 0 ? void 0 : _a.variants) && item.product.variants.length > 0 ? item.product.variants[0].multipleQuantity : 0;
|
|
19204
19222
|
var step = multipleQuantity && multipleQuantity > 0 ? multipleQuantity : 1;
|
|
19205
19223
|
var newQuantity;
|