ng-easycommerce 0.0.664 → 0.0.665-beta.2

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.
@@ -7574,7 +7574,22 @@ var CartEcComponent = /** @class */ (function (_super) {
7574
7574
  _this.getMinimumPurchaseAmount = function () {
7575
7575
  return _this.channel.type == 'b2b' ? _this.channel.wholesalerMinimumPurchaseAmount : _this.channel.retailerMinimumPurchaseAmount;
7576
7576
  };
7577
- _this.exceedsMinimumAmount = function (value) { return value >= _this.getMinimumPurchaseAmount() ? _this.redirectCheckout() : _this.toastrService.show('quantity-not-exceeded', { amount: _this.getMinimumPurchaseAmount() }); };
7577
+ _this.exceedsMinimumAmount = function (value) {
7578
+ if (value >= _this.getMinimumPurchaseAmount()) {
7579
+ return _this.redirectCheckout();
7580
+ }
7581
+ else {
7582
+ // Verificar si hay un balance de cliente activo
7583
+ _this.cartService.balanceCustomer$.subscribe(function (balanceCustomer) {
7584
+ if (balanceCustomer && balanceCustomer.creditAmount !== null && balanceCustomer.creditAmount !== undefined) {
7585
+ _this.toastrService.show('quantity-not-exceeded-whitout-amount');
7586
+ }
7587
+ else {
7588
+ _this.toastrService.show('quantity-not-exceeded', { amount: _this.getMinimumPurchaseAmount() });
7589
+ }
7590
+ }).unsubscribe(); // Desuscribirse inmediatamente después de obtener el valor
7591
+ }
7592
+ };
7578
7593
  _this.ecOnConstruct();
7579
7594
  _this.isLoggedIn = _this.authService.isAuthenticated();
7580
7595
  _this.mediaUrl = _this.consts.mediaUrl();