ng-easycommerce 0.0.640 → 0.0.641
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 +2 -0
- package/bundles/ng-easycommerce.umd.js +12 -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/services/cart.service.js +6 -2
- package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +8 -1
- package/esm5/lib/services/cart.service.js +6 -2
- package/fesm2015/ng-easycommerce.js +12 -1
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +12 -1
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-component/cart-ec/cart-ec.component.d.ts +1 -0
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4927,7 +4927,11 @@
|
|
|
4927
4927
|
};
|
|
4928
4928
|
this.updateItemQuantity = function (item, quantity) {
|
|
4929
4929
|
if (_this.validateQuantity(item, quantity) && (_this.validatePriceAndCredits(item, quantity))) {
|
|
4930
|
-
_this.
|
|
4930
|
+
_this.requestInProcess.next(true);
|
|
4931
|
+
_this.connection
|
|
4932
|
+
.put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)), { 'quantity': Number(quantity) })
|
|
4933
|
+
.pipe(operators.finalize(function () { return _this.requestInProcess.next(false); }))
|
|
4934
|
+
.subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity)); }, function (err) { return _this.handleError(err); });
|
|
4931
4935
|
}
|
|
4932
4936
|
};
|
|
4933
4937
|
this.validateQuantity = function (item, quantity) {
|
|
@@ -7483,6 +7487,7 @@
|
|
|
7483
7487
|
_this.hideTaxes = false;
|
|
7484
7488
|
_this.creditAccountShowPrices = null;
|
|
7485
7489
|
_this.showTaxLegend = false;
|
|
7490
|
+
_this.cartLoading = false;
|
|
7486
7491
|
_this.toDecimal = function (amount) { return _this.consts.toDecimal(amount); };
|
|
7487
7492
|
_this.redirectRegister = function () { return _this.router.navigateByUrl("/auth/login"); };
|
|
7488
7493
|
_this.getVariants = function (product) {
|
|
@@ -7558,11 +7563,17 @@
|
|
|
7558
7563
|
this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
7559
7564
|
_this.creditAccountShowPrices = showPrice;
|
|
7560
7565
|
});
|
|
7566
|
+
this.cartService.loading.subscribe(function (isLoading) {
|
|
7567
|
+
_this.cartLoading = isLoading;
|
|
7568
|
+
});
|
|
7561
7569
|
this.ecOnInit();
|
|
7562
7570
|
};
|
|
7563
7571
|
CartEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
7564
7572
|
var _this = this;
|
|
7565
7573
|
var _a;
|
|
7574
|
+
if (this.cartLoading) {
|
|
7575
|
+
return;
|
|
7576
|
+
}
|
|
7566
7577
|
var multipleQuantity = ((_a = item.product) === null || _a === void 0 ? void 0 : _a.variants) && item.product.variants.length > 0 ? item.product.variants[0].multipleQuantity : 0;
|
|
7567
7578
|
var step = multipleQuantity && multipleQuantity > 0 ? multipleQuantity : 1;
|
|
7568
7579
|
var newQuantity;
|