ng-easycommerce 0.0.586 → 0.0.587

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 CHANGED
@@ -1,3 +1,8 @@
1
+ # version 0.0.587
2
+ - Se agregaron las variables `applyMaxOrders` (booleano) y `maxOrders` (número máximo de órdenes) en `balanceCustomerSubject` dentro de `cart.service.ts`.
3
+ - Se implementó la lógica para manejar estos nuevos valores opcionales.
4
+ - Se agregó una validación para controlar si el usuario ha alcanzado el límite de pedidos permitidos.
5
+ - Se bloquea la posibilidad de agregar artículos al carrito si el usuario ha alcanzado dicho límite y se muestra una alerta
1
6
  # version 0.0.586
2
7
  - Se agrego la función `hasParams` en `block-banner-boxes-ec.component.ts` para obtener los parametros desde el block
3
8
  # version 0.0.585
@@ -276,5 +276,6 @@
276
276
  "date": "Data",
277
277
  "repeat-order": "Repetir comanda",
278
278
  "no-products-to-add": "No hi ha productes per afegir",
279
- "not-enough-credits": "No té prou crèdits per comprar aquest producte"
279
+ "not-enough-credits": "No té prou crèdits per comprar aquest producte",
280
+ "max-orders-reached": "Has assolit el nombre màxim de comandes"
280
281
  }
@@ -380,5 +380,6 @@
380
380
  "no-products-to-add": "You have no products to add",
381
381
  "not-enough-credits": "You do not have enough credits to make this purchase.",
382
382
  "thanks-send-review": "Thank you for leaving a review.",
383
- "authenticated-for-comment": "Please log in to leave a review."
383
+ "authenticated-for-comment": "Please log in to leave a review.",
384
+ "max-orders-reached": "You have reached the maximum number of orders allowed.",
384
385
  }
@@ -385,5 +385,6 @@
385
385
  "no-products-to-add": "No hay productos para agregar",
386
386
  "not-enough-credits": "No tiene suficientes créditos para comprar este producto",
387
387
  "thanks-send-review": "Gracias por dejar una reseña.",
388
- "authenticated-for-comment": "Inicia sesión para dejar una reseña."
388
+ "authenticated-for-comment": "Inicia sesión para dejar una reseña.",
389
+ "max-orders-reached": "Has alcanzado el número máximo de pedidos"
389
390
  }
@@ -268,5 +268,6 @@
268
268
  "date": "Date",
269
269
  "repeat-order": "Répéter la commande",
270
270
  "no-products-to-add": "Aucun produit à ajouter",
271
- "not-enough-credits": "Vous n'avez pas assez de crédits pour acheter ce produit"
271
+ "not-enough-credits": "Vous n'avez pas assez de crédits pour acheter ce produit",
272
+ "max-orders-reached": "Vous avez atteint le nombre maximum de commandes."
272
273
  }
@@ -276,5 +276,6 @@
276
276
  "date": "Data",
277
277
  "repeat-order": "Repetir pedido",
278
278
  "no-products-to-add": "Non hai produtos para engadir",
279
- "not-enough-credits": "Non ten suficientes créditos para realizar a compra"
279
+ "not-enough-credits": "Non ten suficientes créditos para realizar a compra",
280
+ "max-orders-reached": "Acadaches o número máximo de pedidos"
280
281
  }
@@ -276,5 +276,6 @@
276
276
  "date": "Encontro",
277
277
  "repeat-order": "Repetir pedido",
278
278
  "no-products-to-add": "Não há produtos para adicionar",
279
- "not-enough-credits": "Você não tem créditos suficientes para fazer essa compra"
279
+ "not-enough-credits": "Você não tem créditos suficientes para fazer essa compra",
280
+ "max-orders-reached": "Você atingiu o número máximo de pedidos"
280
281
  }
@@ -4531,6 +4531,8 @@
4531
4531
  showMax: false,
4532
4532
  showPrice: false,
4533
4533
  remainingCredits: 0,
4534
+ applyMaxOrders: false,
4535
+ maxOrders: Infinity
4534
4536
  });
4535
4537
  this.items = [];
4536
4538
  this.count = 0;
@@ -4693,6 +4695,11 @@
4693
4695
  * CART CRUD
4694
4696
  */
4695
4697
  this.addToCart = function (product, quantity, variant_id) {
4698
+ var balance = _this.balanceCustomerSubject.value;
4699
+ if (balance.applyMaxOrders && (balance.maxOrders <= 0 || balance.maxOrders === null)) {
4700
+ _this.toastrService.show('max-orders-reached');
4701
+ return;
4702
+ }
4696
4703
  if (!_this.authService.isAbleToBuy()) {
4697
4704
  _this.toastrService.show('must-select-customer');
4698
4705
  return;
@@ -5058,7 +5065,7 @@
5058
5065
  }));
5059
5066
  };
5060
5067
  CartService$1.prototype.updateBalanceAttributes = function (cartData) {
5061
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
5068
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
5062
5069
  var balanceData = {
5063
5070
  allowAnyPaymentMethod: (_b = (_a = cartData) === null || _a === void 0 ? void 0 : _a.allowAnyPaymentMethod, (_b !== null && _b !== void 0 ? _b : false)),
5064
5071
  allowExceedBalance: (_d = (_c = cartData) === null || _c === void 0 ? void 0 : _c.allowExceedBalance, (_d !== null && _d !== void 0 ? _d : false)),
@@ -5068,6 +5075,8 @@
5068
5075
  remainingCredits: ((_l = cartData) === null || _l === void 0 ? void 0 : _l.creditAmount) && ((_m = cartData) === null || _m === void 0 ? void 0 : _m.creditAmount) >= ((_o = cartData) === null || _o === void 0 ? void 0 : _o.totals.total)
5069
5076
  ? ((_p = cartData) === null || _p === void 0 ? void 0 : _p.creditAmount) - ((_q = cartData) === null || _q === void 0 ? void 0 : _q.totals.total)
5070
5077
  : 0,
5078
+ applyMaxOrders: (_s = (_r = cartData) === null || _r === void 0 ? void 0 : _r.applyMaxOrders, (_s !== null && _s !== void 0 ? _s : false)),
5079
+ maxOrders: (_u = (_t = cartData) === null || _t === void 0 ? void 0 : _t.maxOrders, (_u !== null && _u !== void 0 ? _u : Infinity))
5071
5080
  };
5072
5081
  this.balanceCustomerSubject.next(balanceData);
5073
5082
  };