ng-easycommerce 0.0.623 → 0.0.624
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 +3 -0
- package/assets/ec-i18n/ct.json +2 -1
- package/assets/ec-i18n/en.json +2 -1
- package/assets/ec-i18n/es.json +1 -0
- package/assets/ec-i18n/fr.json +2 -1
- package/assets/ec-i18n/gl.json +2 -1
- package/assets/ec-i18n/pr.json +2 -1
- package/bundles/ng-easycommerce.umd.js +48 -19
- 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/product-detail-ec/product-detail-ec.component.js +35 -17
- package/esm2015/lib/services/products/product-detail.service.js +11 -4
- package/esm5/lib/ec-component/product-detail-ec/product-detail-ec.component.js +39 -17
- package/esm5/lib/services/products/product-detail.service.js +11 -4
- package/fesm2015/ng-easycommerce.js +44 -19
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +48 -19
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/ec-component/product-detail-ec/product-detail-ec.component.d.ts +9 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# version 0.0.624
|
|
2
|
+
- Se modificaron las funciones `plus` y `less` en `product-detail.component` para que tengan en cuenta la suma o resta de cantidades por múltiplos.
|
|
3
|
+
- En `product-detail.service` se agregó la validación para asegurar que la cantidad ingresada sea múltiplo del valor permitido.
|
|
1
4
|
# version 0.0.623
|
|
2
5
|
- Arreglo traducciones en checkout, y texto flotante.
|
|
3
6
|
# version 0.0.622
|
package/assets/ec-i18n/ct.json
CHANGED
|
@@ -294,5 +294,6 @@
|
|
|
294
294
|
"national-taxes": "Impostos nacionals",
|
|
295
295
|
"taxes": "Impostos",
|
|
296
296
|
"price-without-national-taxes": "Preu sense impostos nacionals",
|
|
297
|
-
"this-payment-method-cannot-be-used": "Aquest mètode de pagament no es pot utilitzar"
|
|
297
|
+
"this-payment-method-cannot-be-used": "Aquest mètode de pagament no es pot utilitzar",
|
|
298
|
+
"must-be-multiple": "La quantitat total ha de ser un múltiple de {{quantity}}"
|
|
298
299
|
}
|
package/assets/ec-i18n/en.json
CHANGED
|
@@ -405,5 +405,6 @@
|
|
|
405
405
|
"clientTaxes": "Taxes per customer",
|
|
406
406
|
"email_already_registered": "The email entered is already registered.",
|
|
407
407
|
"mail-enter": "Mail",
|
|
408
|
-
"this-payment-method-cannot-be-used": "This payment method cannot be used"
|
|
408
|
+
"this-payment-method-cannot-be-used": "This payment method cannot be used",
|
|
409
|
+
"must-be-multiple": "The total quantity must be a multiple of {{quantity}}"
|
|
409
410
|
}
|
package/assets/ec-i18n/es.json
CHANGED
|
@@ -174,6 +174,7 @@
|
|
|
174
174
|
"men-fashion": "Hombres",
|
|
175
175
|
"mercado-pago": "Mercado Pago",
|
|
176
176
|
"minimum-items-quantity": "La cantidad minima de compra del producto es {{quantity}}",
|
|
177
|
+
"must-be-multiple": "La cantidad total debe ser múltiplo de {{quantity}}",
|
|
177
178
|
"most-expensive-first": "Mayor precio",
|
|
178
179
|
"my-account": "Mi cuenta",
|
|
179
180
|
"my-account-description": "Desde el panel de Mi cuenta, tiene la capacidad de ver una instantánea de la actividad reciente de su cuenta y actualizar su información personal. Seleccione un enlace de abajo para ver o editar información.",
|
package/assets/ec-i18n/fr.json
CHANGED
|
@@ -286,5 +286,6 @@
|
|
|
286
286
|
"national-taxes": "Taxes nationales",
|
|
287
287
|
"taxes": "Taxes",
|
|
288
288
|
"price-without-national-taxes": "Prix sans taxes nationales",
|
|
289
|
-
"this-payment-method-cannot-be-used": "Ce mode de paiement ne peut pas être utilisé"
|
|
289
|
+
"this-payment-method-cannot-be-used": "Ce mode de paiement ne peut pas être utilisé",
|
|
290
|
+
"must-be-multiple": "La quantité totale doit être un multiple de {{quantity}}"
|
|
290
291
|
}
|
package/assets/ec-i18n/gl.json
CHANGED
|
@@ -294,5 +294,6 @@
|
|
|
294
294
|
"national-taxes": "Impostos nacionais",
|
|
295
295
|
"taxes": "Impostos",
|
|
296
296
|
"price-without-national-taxes": "Prezo sen impostos nacionais",
|
|
297
|
-
"this-payment-method-cannot-be-used": "Este método de pago non pode ser usado"
|
|
297
|
+
"this-payment-method-cannot-be-used": "Este método de pago non pode ser usado",
|
|
298
|
+
"must-be-multiple": "A cantidade total debe ser múltiplo de {{quantity}}"
|
|
298
299
|
}
|
package/assets/ec-i18n/pr.json
CHANGED
|
@@ -294,5 +294,6 @@
|
|
|
294
294
|
"national-taxes": "Impostos nacionais",
|
|
295
295
|
"taxes": "Impostos",
|
|
296
296
|
"price-without-national-taxes": "Preço sem impostos nacionais",
|
|
297
|
-
"this-payment-method-cannot-be-used": "Este método de pagamento não pode ser utilizado"
|
|
297
|
+
"this-payment-method-cannot-be-used": "Este método de pagamento não pode ser utilizado",
|
|
298
|
+
"must-be-multiple": "A quantidade total deve ser um múltiplo de {{quantity}}"
|
|
298
299
|
}
|
|
@@ -10736,15 +10736,22 @@
|
|
|
10736
10736
|
this.validateQuantity = function (quantity) {
|
|
10737
10737
|
var actualQuantity = _this.cartService.getCountFromItemInCart(_this.variants[0].code);
|
|
10738
10738
|
var asociatedData = _this.asociatedDataSubject.value;
|
|
10739
|
-
|
|
10740
|
-
|
|
10739
|
+
var totalQuantity = actualQuantity + quantity;
|
|
10740
|
+
console.log('La cantidad que llegó: ', quantity, ' y la cantidad actual: ', actualQuantity);
|
|
10741
|
+
if (asociatedData.maximumItemsQuantity && totalQuantity > asociatedData.maximumItemsQuantity) {
|
|
10741
10742
|
_this.toastrService.show('maximum-items-quantity', { quantity: asociatedData.maximumItemsQuantity });
|
|
10742
10743
|
return false;
|
|
10743
10744
|
}
|
|
10744
|
-
if (
|
|
10745
|
+
if (asociatedData.minimumItemsQuantity && totalQuantity < asociatedData.minimumItemsQuantity) {
|
|
10745
10746
|
_this.toastrService.show('minimum-items-quantity', { quantity: asociatedData.minimumItemsQuantity });
|
|
10746
10747
|
return false;
|
|
10747
10748
|
}
|
|
10749
|
+
if (asociatedData.multipleQuantity && asociatedData.multipleQuantity > 0) {
|
|
10750
|
+
if (totalQuantity % asociatedData.multipleQuantity !== 0) {
|
|
10751
|
+
_this.toastrService.show('must-be-multiple', { quantity: asociatedData.multipleQuantity });
|
|
10752
|
+
return false;
|
|
10753
|
+
}
|
|
10754
|
+
}
|
|
10748
10755
|
return true;
|
|
10749
10756
|
};
|
|
10750
10757
|
this.validatePriceAndCredits = function (price) {
|
|
@@ -10975,29 +10982,51 @@
|
|
|
10975
10982
|
};
|
|
10976
10983
|
/**
|
|
10977
10984
|
* @description actualiza la variable quantity sumandole 'x' contenido.
|
|
10978
|
-
* @param stock
|
|
10979
|
-
* @param
|
|
10985
|
+
* @param stock número máximo disponible en stock.
|
|
10986
|
+
* @param changeAmount cantidad que se quiere sumar.
|
|
10987
|
+
* @param forceMultiple si es true, obliga a que el resultado sea múltiplo de changeAmount.
|
|
10980
10988
|
*/
|
|
10981
|
-
_this.plus = function (stock,
|
|
10982
|
-
if (
|
|
10983
|
-
|
|
10984
|
-
|
|
10989
|
+
_this.plus = function (stock, changeAmount, forceMultiple) {
|
|
10990
|
+
if (changeAmount === void 0) { changeAmount = 1; }
|
|
10991
|
+
if (forceMultiple === void 0) { forceMultiple = false; }
|
|
10992
|
+
var newQuantity = _this.quantity + changeAmount;
|
|
10993
|
+
if (forceMultiple && changeAmount > 0) {
|
|
10994
|
+
if (_this.quantity < changeAmount) {
|
|
10995
|
+
newQuantity = changeAmount;
|
|
10996
|
+
}
|
|
10997
|
+
else {
|
|
10998
|
+
newQuantity = Math.ceil(newQuantity / changeAmount) * changeAmount;
|
|
10999
|
+
}
|
|
11000
|
+
}
|
|
11001
|
+
if (!stock || newQuantity <= stock) {
|
|
11002
|
+
_this.quantity = newQuantity;
|
|
10985
11003
|
}
|
|
10986
11004
|
else {
|
|
10987
|
-
|
|
10988
|
-
: _this.quantity = _this.quantity + 1;
|
|
11005
|
+
_this.toastrService.show('out-of-stock-actually');
|
|
10989
11006
|
}
|
|
10990
11007
|
};
|
|
10991
11008
|
/**
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
10997
|
-
|
|
11009
|
+
* @description actualiza la variable quantity restandole 'x' contenido.
|
|
11010
|
+
* @param changeAmount cantidad que se quiere restar.
|
|
11011
|
+
* @param forceMultiple si es true, obliga a que el resultado sea múltiplo de changeAmount.
|
|
11012
|
+
*/
|
|
11013
|
+
_this.less = function (changeAmount, forceMultiple) {
|
|
11014
|
+
if (changeAmount === void 0) { changeAmount = 1; }
|
|
11015
|
+
if (forceMultiple === void 0) { forceMultiple = false; }
|
|
11016
|
+
var newQuantity = _this.quantity - changeAmount;
|
|
11017
|
+
if (forceMultiple && changeAmount > 0) {
|
|
11018
|
+
if (_this.quantity <= changeAmount) {
|
|
11019
|
+
newQuantity = changeAmount;
|
|
11020
|
+
}
|
|
11021
|
+
else {
|
|
11022
|
+
newQuantity = Math.floor(newQuantity / changeAmount) * changeAmount;
|
|
11023
|
+
}
|
|
11024
|
+
if (newQuantity < changeAmount) {
|
|
11025
|
+
newQuantity = changeAmount;
|
|
11026
|
+
}
|
|
10998
11027
|
}
|
|
10999
|
-
|
|
11000
|
-
_this.quantity
|
|
11028
|
+
if (newQuantity >= 1) {
|
|
11029
|
+
_this.quantity = newQuantity;
|
|
11001
11030
|
}
|
|
11002
11031
|
};
|
|
11003
11032
|
_this.showContact = function () { return _this.show = true; };
|