ng-easycommerce 0.0.658-beta.1 → 0.0.660-beta.1
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 +58 -22
- package/assets/ec-i18n/en.json +1 -3
- package/assets/ec-i18n/es.json +1 -3
- package/bundles/ng-easycommerce.umd.js +515 -181
- 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/core.consts.js +1 -6
- package/esm2015/lib/ec-component/account-ec/order-ec/order-ec.component.js +3 -5
- package/esm2015/lib/ec-component/cart-ec/cart-ec.component.js +5 -8
- package/esm2015/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +8 -13
- package/esm2015/lib/ec-component/collection-ec/collection-ec.component.js +450 -14
- package/esm2015/lib/ec-component/product-detail-ec/product-detail-ec.component.js +3 -30
- package/esm2015/lib/ec-component/product-ec/product-ec.component.js +2 -1
- package/esm2015/lib/ec-component/sidebar-ec/sidebar-ec.component.js +5 -8
- package/esm2015/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +3 -1
- package/esm2015/lib/ec-component/widgets-ec/price-ec/price-ec.component.js +3 -3
- package/esm2015/lib/ec-pipe/ec-currency-symbol.pipe.js +1 -2
- package/esm2015/lib/services/cart.service.js +12 -27
- package/esm2015/lib/services/currency.service.js +7 -43
- package/esm5/lib/core.consts.js +1 -6
- package/esm5/lib/ec-component/account-ec/order-ec/order-ec.component.js +3 -5
- package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +5 -8
- package/esm5/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +8 -13
- package/esm5/lib/ec-component/collection-ec/collection-ec.component.js +458 -13
- package/esm5/lib/ec-component/product-detail-ec/product-detail-ec.component.js +3 -48
- package/esm5/lib/ec-component/product-ec/product-ec.component.js +2 -1
- package/esm5/lib/ec-component/sidebar-ec/sidebar-ec.component.js +5 -8
- package/esm5/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +3 -1
- package/esm5/lib/ec-component/widgets-ec/price-ec/price-ec.component.js +3 -3
- package/esm5/lib/ec-pipe/ec-currency-symbol.pipe.js +1 -2
- package/esm5/lib/services/cart.service.js +12 -27
- package/esm5/lib/services/currency.service.js +7 -43
- package/fesm2015/ng-easycommerce.js +502 -159
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +516 -182
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/core.consts.d.ts +0 -5
- package/lib/ec-component/account-ec/order-ec/order-ec.component.d.ts +0 -1
- package/lib/ec-component/cart-ec/cart-ec.component.d.ts +0 -1
- package/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.d.ts +1 -1
- package/lib/ec-component/collection-ec/collection-ec.component.d.ts +34 -4
- package/lib/ec-component/product-detail-ec/product-detail-ec.component.d.ts +0 -3
- package/lib/ec-component/sidebar-ec/sidebar-ec.component.d.ts +0 -1
- package/lib/services/cart.service.d.ts +2 -2
- package/lib/services/currency.service.d.ts +2 -14
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
|
|
7
7
|
import { ToastrService, ToastrModule } from 'ngx-toastr';
|
|
8
8
|
import { ReplaySubject, of, BehaviorSubject, forkJoin, combineLatest, Observable, throwError } from 'rxjs';
|
|
9
9
|
import 'rxjs/add/operator/map';
|
|
10
|
-
import { take, map, catchError, filter, mapTo, finalize,
|
|
10
|
+
import { take, map, catchError, filter, mapTo, finalize, skipWhile, concatMap } from 'rxjs/operators';
|
|
11
11
|
import 'rxjs/add/operator/catch';
|
|
12
12
|
import 'rxjs/add/observable/of';
|
|
13
13
|
import * as moment from 'moment';
|
|
@@ -469,11 +469,6 @@ let Constants = class Constants {
|
|
|
469
469
|
* @example ['AR','ES','GB']
|
|
470
470
|
*/
|
|
471
471
|
this.countries = [];
|
|
472
|
-
/**
|
|
473
|
-
* @description contiene un arreglo de string cuyo contenido son los codigos de los paises a excluir.
|
|
474
|
-
* @example ['GB']
|
|
475
|
-
*/
|
|
476
|
-
this.excludedCountries = [];
|
|
477
472
|
/**
|
|
478
473
|
*
|
|
479
474
|
* @param countries debe contener los codigos de los paises que se quiere mostrar
|
|
@@ -4037,22 +4032,12 @@ let CartService = class CartService {
|
|
|
4037
4032
|
this.updateLocalCart();
|
|
4038
4033
|
this.requestInProcess.next(false);
|
|
4039
4034
|
};
|
|
4040
|
-
this.updateCartItemQuantity = (variant_id, quantity
|
|
4041
|
-
|
|
4042
|
-
const newItems = this.items.map(it => {
|
|
4043
|
-
if (it.variant_id !== variant_id)
|
|
4044
|
-
return it;
|
|
4045
|
-
const updated = Object.assign(Object.assign({}, it), { quantity: Number(quantity) });
|
|
4046
|
-
if (normalizedComments !== undefined) {
|
|
4047
|
-
updated.comments = normalizedComments;
|
|
4048
|
-
}
|
|
4049
|
-
return updated;
|
|
4050
|
-
});
|
|
4051
|
-
this.items = newItems;
|
|
4035
|
+
this.updateCartItemQuantity = (variant_id, quantity) => {
|
|
4036
|
+
let newQuantity = this.items.find(item => item.variant_id == variant_id).quantity = quantity;
|
|
4052
4037
|
this.cartItemsSubject.next(this.items);
|
|
4053
4038
|
this.requestInProcess.next(false);
|
|
4054
4039
|
this.updateLocalCart();
|
|
4055
|
-
this.toastrService.show('product-updated', { quantity });
|
|
4040
|
+
this.toastrService.show('product-updated', { quantity: newQuantity });
|
|
4056
4041
|
};
|
|
4057
4042
|
this.appendToCart = (cart) => {
|
|
4058
4043
|
this.updateCartObj(cart);
|
|
@@ -4073,9 +4058,9 @@ let CartService = class CartService {
|
|
|
4073
4058
|
// this.googleAnalytics.removeFromCart(product);
|
|
4074
4059
|
this.analyticsService.callEvent('remove_from_cart', Object.assign(Object.assign({}, product), { currency: this.consts.currency.code }));
|
|
4075
4060
|
};
|
|
4076
|
-
this.addIfAllreadyExists = (product, variant_id, quantityAdd = 1
|
|
4061
|
+
this.addIfAllreadyExists = (product, variant_id, quantityAdd = 1) => this.items.find((item, index) => {
|
|
4077
4062
|
if (item.product.id == product.id && item.variant_id == variant_id) {
|
|
4078
|
-
this.updateItemQuantity(item, this.findItem(product.id).quantity + quantityAdd
|
|
4063
|
+
this.updateItemQuantity(item, this.findItem(product.id).quantity + quantityAdd);
|
|
4079
4064
|
return true;
|
|
4080
4065
|
}
|
|
4081
4066
|
return false;
|
|
@@ -4127,7 +4112,7 @@ let CartService = class CartService {
|
|
|
4127
4112
|
return;
|
|
4128
4113
|
}
|
|
4129
4114
|
this.requestInProcess.next(true);
|
|
4130
|
-
let added = this.addIfAllreadyExists(product, variant_id, quantity
|
|
4115
|
+
let added = this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4131
4116
|
if (!added) {
|
|
4132
4117
|
const payload = {
|
|
4133
4118
|
productCode: product.id,
|
|
@@ -4167,13 +4152,13 @@ let CartService = class CartService {
|
|
|
4167
4152
|
!added && this.connection.post(this.addItemApi(), { productCode: product.id, quantity: quantity, variantCode: variant_id, id: id || '', order_item_id: order_item_id || '', lot_quantity: lot_quantity || '', unit_price: unit_price || '', unit_total: unit_total || '', ajustement_total: ajustement_total || '', total_lot: total_lot || '', lot_status: lot_status || '', date_request: date_request || '', notes: notes || '', shipping_address_id: shipping_address_id || '', shipping_address_name: shipping_address_name || '', action: action || 'newlot' })
|
|
4168
4153
|
.subscribe(res => this.appendToCart(res), err => this.handleError(err));
|
|
4169
4154
|
};
|
|
4170
|
-
this.addToCartPromise = (product, quantity, variant_id
|
|
4155
|
+
this.addToCartPromise = (product, quantity, variant_id) => __awaiter$5(this, void 0, void 0, function* () {
|
|
4171
4156
|
if (!this.authService.isAbleToBuy()) {
|
|
4172
4157
|
this.toastrService.show('must-select-customer');
|
|
4173
4158
|
return;
|
|
4174
4159
|
}
|
|
4175
4160
|
this.requestInProcess.next(true);
|
|
4176
|
-
let added = this.addIfAllreadyExists(product, variant_id, quantity
|
|
4161
|
+
let added = this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4177
4162
|
if (!added) {
|
|
4178
4163
|
let result = yield (this.connection.post(this.addItemApi(), { productCode: product.id, quantity: quantity, variantCode: variant_id }).toPromise());
|
|
4179
4164
|
if (!result || result.error)
|
|
@@ -4215,18 +4200,13 @@ let CartService = class CartService {
|
|
|
4215
4200
|
items = items.filter(itemParam => !this.items.find(item => itemParam.variantCode == item.variant_id));
|
|
4216
4201
|
return [...items, ...paramsMerge];
|
|
4217
4202
|
};
|
|
4218
|
-
this.updateItemQuantity = (item, quantity
|
|
4203
|
+
this.updateItemQuantity = (item, quantity) => {
|
|
4219
4204
|
if (this.validateQuantity(item, quantity) && (this.validatePriceAndCredits(item, quantity))) {
|
|
4220
4205
|
this.requestInProcess.next(true);
|
|
4221
|
-
const payload = { quantity: Number(quantity) };
|
|
4222
|
-
if (comments !== undefined) {
|
|
4223
|
-
const cleaned = ((comments !== null && comments !== void 0 ? comments : '')).trim();
|
|
4224
|
-
payload.comments = cleaned;
|
|
4225
|
-
}
|
|
4226
4206
|
this.connection
|
|
4227
|
-
.put(this.updateItemQuantityApi(this.findItemByIdVariant(item.variant_id)),
|
|
4207
|
+
.put(this.updateItemQuantityApi(this.findItemByIdVariant(item.variant_id)), { 'quantity': Number(quantity) })
|
|
4228
4208
|
.pipe(finalize(() => this.requestInProcess.next(false)))
|
|
4229
|
-
.subscribe(res => this.updateCartObj(res) && this.updateCartItemQuantity(item.variant_id, Number(quantity)
|
|
4209
|
+
.subscribe(res => this.updateCartObj(res) && this.updateCartItemQuantity(item.variant_id, Number(quantity)), err => this.handleError(err));
|
|
4230
4210
|
}
|
|
4231
4211
|
};
|
|
4232
4212
|
this.validateQuantity = (item, quantity) => {
|
|
@@ -6324,7 +6304,6 @@ let CartEcComponent = class CartEcComponent extends ComponentHelper {
|
|
|
6324
6304
|
this.creditAccountShowPrices = null;
|
|
6325
6305
|
this.showTaxLegend = false;
|
|
6326
6306
|
this.cartLoading = false;
|
|
6327
|
-
this.enableFieldNotesInArticleFile = false;
|
|
6328
6307
|
this.toDecimal = (amount) => this.consts.toDecimal(amount);
|
|
6329
6308
|
this.redirectRegister = () => this.router.navigateByUrl(`/auth/login`);
|
|
6330
6309
|
this.getVariants = product => {
|
|
@@ -6386,12 +6365,11 @@ let CartEcComponent = class CartEcComponent extends ComponentHelper {
|
|
|
6386
6365
|
this.cartService.promotions.subscribe(promotions => this.promotions = promotions);
|
|
6387
6366
|
// console.log(this.cartService.getTaxes());
|
|
6388
6367
|
this.channelConfigService.channelConfig$.subscribe(channel => {
|
|
6389
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
6368
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6390
6369
|
this.hidePrices = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
6391
6370
|
this.hideDiscounts = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.hideDiscounts, (_d !== null && _d !== void 0 ? _d : false));
|
|
6392
6371
|
this.hideTaxes = (_f = (_e = channel) === null || _e === void 0 ? void 0 : _e.hideTaxes, (_f !== null && _f !== void 0 ? _f : false));
|
|
6393
6372
|
this.showTaxLegend = (_h = (_g = channel) === null || _g === void 0 ? void 0 : _g.showTaxLegend, (_h !== null && _h !== void 0 ? _h : false));
|
|
6394
|
-
this.enableFieldNotesInArticleFile = (_k = (_j = channel) === null || _j === void 0 ? void 0 : _j.enableFieldNotesInArticleFile, (_k !== null && _k !== void 0 ? _k : false));
|
|
6395
6373
|
if (this.hidePrices) {
|
|
6396
6374
|
this.router.navigate(['/']);
|
|
6397
6375
|
}
|
|
@@ -6405,7 +6383,7 @@ let CartEcComponent = class CartEcComponent extends ComponentHelper {
|
|
|
6405
6383
|
this.ecOnInit();
|
|
6406
6384
|
}
|
|
6407
6385
|
actualizarCantidad(item, cantidad, stock, id) {
|
|
6408
|
-
var _a
|
|
6386
|
+
var _a;
|
|
6409
6387
|
if (this.cartLoading) {
|
|
6410
6388
|
return;
|
|
6411
6389
|
}
|
|
@@ -6425,11 +6403,10 @@ let CartEcComponent = class CartEcComponent extends ComponentHelper {
|
|
|
6425
6403
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
6426
6404
|
}
|
|
6427
6405
|
}
|
|
6428
|
-
const keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
6429
6406
|
if (id) {
|
|
6430
6407
|
this.isDisabled = true; // Actualiza la propiedad vinculada a `[disabled]`
|
|
6431
6408
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
6432
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
6409
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
6433
6410
|
}
|
|
6434
6411
|
else {
|
|
6435
6412
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -6440,7 +6417,7 @@ let CartEcComponent = class CartEcComponent extends ComponentHelper {
|
|
|
6440
6417
|
}
|
|
6441
6418
|
else {
|
|
6442
6419
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
6443
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
6420
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
6444
6421
|
}
|
|
6445
6422
|
else {
|
|
6446
6423
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -6897,7 +6874,6 @@ let DataFormEcComponent = class DataFormEcComponent extends ComponentHelper {
|
|
|
6897
6874
|
this.postalCodeErrorMessageFacturacion = "";
|
|
6898
6875
|
this.documentErrorMessage = "";
|
|
6899
6876
|
this.documentErrorMessageFacturacion = "";
|
|
6900
|
-
this.customerHasCustomerTaxRate = false;
|
|
6901
6877
|
/**
|
|
6902
6878
|
* @description filtra los paises de acuerdo al a los codigos retornados en la funcion getCountries.
|
|
6903
6879
|
* Casos de usos: Si getCountries es vacio, retorna el arreglo que ingresa por parametro.
|
|
@@ -6907,24 +6883,18 @@ let DataFormEcComponent = class DataFormEcComponent extends ComponentHelper {
|
|
|
6907
6883
|
* @returns un arreglo de countries.
|
|
6908
6884
|
*/
|
|
6909
6885
|
this.filterCountryByCode = (countries) => {
|
|
6910
|
-
// 1. Si hay países EXCLUIDOS, quítalos siempre
|
|
6911
|
-
let filtered = countries;
|
|
6912
|
-
if (this.consts.excludedCountries && this.consts.excludedCountries.length > 0) {
|
|
6913
|
-
filtered = filtered.filter(elem => !this.consts.excludedCountries.includes(elem.code));
|
|
6914
|
-
}
|
|
6915
|
-
// 2. Si hay países INCLUIDOS, aplica el filtro de inclusión
|
|
6916
6886
|
if (this.consts.getCountries().length > 0) {
|
|
6917
|
-
let countriesFiltered =
|
|
6887
|
+
let countriesFiltered = countries.filter(elem => this.consts.getCountries().includes(elem.code));
|
|
6918
6888
|
if (countriesFiltered.length > 0) {
|
|
6919
6889
|
return countriesFiltered;
|
|
6920
6890
|
}
|
|
6921
6891
|
else {
|
|
6922
6892
|
console.error('El/los codigo/s ingresado/s no coinciden con los provistos desde el backend');
|
|
6923
|
-
return
|
|
6893
|
+
return countries;
|
|
6924
6894
|
}
|
|
6925
6895
|
}
|
|
6926
6896
|
else {
|
|
6927
|
-
return
|
|
6897
|
+
return countries;
|
|
6928
6898
|
}
|
|
6929
6899
|
};
|
|
6930
6900
|
this.showFormFacturacion = () => {
|
|
@@ -7151,7 +7121,6 @@ let DataFormEcComponent = class DataFormEcComponent extends ComponentHelper {
|
|
|
7151
7121
|
this.paramsService.parameters.subscribe(res => this.params = res);
|
|
7152
7122
|
this.addressingService.initialize(this.step_id);
|
|
7153
7123
|
const localEmail = localStorage.getItem('mail');
|
|
7154
|
-
this.cartService.cart.subscribe(cart => { var _a; return this.customerHasCustomerTaxRate = (_a = cart) === null || _a === void 0 ? void 0 : _a.customerHasCustomerTaxRate; });
|
|
7155
7124
|
this.authService.isAuthenticated() && this.checkoutForm.controls['email'].setValue(((_a = this.authService.getCustomer()) === null || _a === void 0 ? void 0 : _a.email) || localEmail);
|
|
7156
7125
|
this.authService.isAuthenticated() && this.checkoutForm.get('email').disable({ onlySelf: true });
|
|
7157
7126
|
this.addressingService.getAddressingData().then(res => {
|
|
@@ -7232,6 +7201,9 @@ let DataFormEcComponent = class DataFormEcComponent extends ComponentHelper {
|
|
|
7232
7201
|
updateDocumentValidationFacturacion(selectedDocumentType) {
|
|
7233
7202
|
this.updateValidation(selectedDocumentType, 'documentNumber', this.checkoutFormFacturacion, 'documentErrorMessageFacturacion', 'isNumeric', 'document-pattern-error');
|
|
7234
7203
|
}
|
|
7204
|
+
prueba(x) {
|
|
7205
|
+
console.log(x);
|
|
7206
|
+
}
|
|
7235
7207
|
};
|
|
7236
7208
|
DataFormEcComponent.ctorParameters = () => [
|
|
7237
7209
|
{ type: AuthService },
|
|
@@ -7256,7 +7228,7 @@ __decorate$Q([
|
|
|
7256
7228
|
DataFormEcComponent = __decorate$Q([
|
|
7257
7229
|
Component({
|
|
7258
7230
|
selector: 'app-dataform-ec',
|
|
7259
|
-
template: "<ng-container\r\n *ngIf=\"this.channelConfig.channelType != 'b2b' || (this.channelConfig.channelType == 'b2b' && authService.isAuthenticated()); else pleaseLogin\">\r\n <ng-container\r\n *ngIf=\"this.addressingService.modeSelectAddress == 'LOAD_ADDRESS_AND_SELECTION' && this.authService.isAuthenticated() && this.addressBook != null\">\r\n <div class=\"container card p-4 mb-3\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-10 col-lg-8 text-center\">\r\n <div class=\"btn-group btn-group-toggle\" data-bs-toggle=\"buttons\">\r\n <label [class]=\"'btn btn-outline-secondary ' + (!getMode() ? 'active' : '')\">\r\n <input type=\"radio\" name=\"options\" id=\"option1\" autocomplete=\"off\" checked\r\n (change)=\"setMode('seleccion')\"> {{'select-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (getMode() ? 'active' : '')\"\r\n *ngIf=\"!getParamByChannelAndLanguage('btn_new_address_') && customerHasCustomerTaxRate\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\"\r\n (change)=\"setMode('carga')\">\r\n {{ 'new-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (selectAddress ? 'active' : '')\"\r\n *ngIf=\"getParamByChannelAndLanguage('btn_new_address_') as param\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\"\r\n (change)=\"setMode('carga')\">\r\n {{ param.value}}\r\n </label>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getMode(); else addressSelection\">\r\n <div *ngIf=\"!require_login; else requireLoginView\">\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_LOAD_ADDRESS'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'billing-details'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <form (submit)=\"verifyValidate(false,this.cartService.items)\">\r\n <div class=\"row mt-df\"><!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutForm.controls['firstName']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutForm.controls['lastName']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"phoneNumber\"\r\n [formControl]=\"checkoutForm.controls['phoneNumber']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutForm.controls['email']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 3-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(countries$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutForm.controls['countryCode']\"\r\n (change)=\"onCountrySelected($event.target.value)\">\r\n <!-- <option selected [value]=\"countries[0].code\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">{{ country.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.countryCode.touched && checkoutForm.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(provinces$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option>\r\n -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">{{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.provinceCode.touched && checkoutForm.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutForm.controls['city']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.city.touched && checkoutForm.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span>\r\n <span class=\"char-count ms-2\" style=\"font-size: 0.9em; color: #888;\">\r\n {{ 50 - (checkoutForm.controls['street'].value?.length || 0) }} {{'remainingCharacters'|translate}}\r\n </span>\r\n </label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutForm.controls['street']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n\r\n <!-- form direcci\u00F3n -->\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutForm.controls['postcode']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\"> {{postalCodeErrorMessage | translate}} </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypes$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n (change)=\"onDocumentTypesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['documentType']\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option>\r\n -->\r\n <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentType.touched && checkoutForm.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutForm.controls['documentNumber']\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">{{ 'document-number-help' | translate }}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"><!--Fila 6-->\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\"\r\n [innerHTML]=\"labelnotes.value\"><span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutForm.controls['notes']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 7-->\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label for=\"formFact\"><b>{{ 'same-billing-address' | translate }}</b> <input type=\"checkbox\"\r\n class=\"ms-2\" [checked]=\"viewDataFacturacion\" (change)=\"showFormFacturacion()\"\r\n id=\"formFact\"></label>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"col-12\">\r\n <p>\r\n <!-- <span class=\"required\"></span> -->\r\n <label class=\"required text-underline\">* {{ 'required-fields' | translate }}</label>\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.enabled\">\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.required\"\r\n class=\"required\">*</span>\r\n <label class=\"\" for=\"\"> {{ 'accept-terms' | translate }} <input class=\"ms-2\" name=\"terms\"\r\n [formControl]=\"checkoutForm.controls['terms']\" type=\"checkbox\" required\r\n (change)=\"onInputChange()\" /> </label><br />\r\n <a (click)=\"openModal(template)\" role=\"button\" class=\"ms-3 nota-input text-dark\">{{ 'whats-this'\r\n |\r\n translate }}</a>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.terms.touched && !checkoutForm.controls.terms.value\">\r\n <span class=\"text-danger\">{{ 'must-accept-terms' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"viewDataFacturacion ; else datosFormFacturacion\"> </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button type=\"submit\" [disabled]=\"!validado\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}</button>\r\n\r\n\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </form>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-template #addressSelection>\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_ADDRESS_SELECTION'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'address-selection'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"this.addressBook; else addressBookNotResult\">\r\n\r\n <ng-container *ngIf=\"this.addressBook?.length ;else addressBookLoading\">\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-6 col-12 my-3\" *ngFor=\"let item of addressBook; let i = index\">\r\n <div class=\"card p-3\">\r\n <input class=\"ms-1 mt-3 form-check-input input-size-lg\" type=\"radio\" [name]=\"'n-'+i\"\r\n [id]=\"i\" [checked]=\"item.selected\" (click)=\"setSelectAddress(item)\"\r\n (change)=\"onInputChange()\">\r\n <div class=\"ms-5\">\r\n <h4 class=\"card-title\">\r\n <strong>{{'address'|translate}}</strong><br>\r\n <span class=\"text-uppercase h3\">{{item.street}}</span>\r\n </h4>\r\n <div class=\"row\">\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'country'|translate}}</strong> {{getCountry(item.countryCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'state'|translate}}</strong> {{getProvince(item.provinceCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'town-city'|translate}}</strong> {{item.city}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'postal-code'|translate}}</strong> {{item.postcode}}\r\n </h5>\r\n </div>\r\n <div class=\"row px-3\">\r\n <div class=\"card p-2 bg-light w-100\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">{{'address-contact'|translate}}</h5>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'first-name'|translate}}</strong>\r\n {{item.addressContact.firstName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'last-name'|translate}}</strong>\r\n {{item.addressContact.lastName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-type'|translate}}</strong>\r\n {{getDocumentType(item.addressContact.documentType)}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-number'|translate}}</strong>\r\n {{item.addressContact.documentNumber}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'email-address'|translate}}</strong>\r\n {{item.addressContact.email}}\r\n </h6>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <!-- Se hardcodea el canal de mundo del juguete empresa A ya que se necesita con urgencia, se sustituira por un campo que llegara de backend. -->\r\n <div class=\"w-100\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\"\r\n [innerHTML]=\"labelnotes.value\"></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [(ngModel)]=\"this.addressBookSelected.notes\" #ctrl=\"ngModel\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"invalid-feedback d-block\" *ngIf=\"\r\n addressingService.getTypeForm().viewForms.notes.required\r\n && (!addressBookSelected.notes || !addressBookSelected.notes.trim())\r\n \">\r\n {{ 'required-field' | translate }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button (click)=\"selectAddress(this.cartService.items)\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}\r\n </button>\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n </ng-template>\r\n\r\n\r\n <ng-template #requireLoginView>\r\n <div id=\"loginCheckout\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\" *ngIf=\"require_login\">\r\n <div class=\"col-12\">\r\n <app-login-form-ec (ready)=\"verifyValidate($event)\" [redirect]=\"false\" [title]=\"'need-login'\">\r\n </app-login-form-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n\r\n\r\n <ng-template #datosFormFacturacion>\r\n <div class=\"container-fluid px-0 px-md-2\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card \">\r\n <div class=\"card-header text-dark text-center\">\r\n <h3>{{'billing-data'|translate}}</h3>\r\n </div>\r\n <div class=\"card-body\">\r\n <form (submit)=\"verifyValidate()\">\r\n <div class=\"row mt-df\">\r\n <!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['firstName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['lastName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"phoneNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['phoneNumber']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutFormFacturacion.controls['email']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 3-->\r\n\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(countriesFacturacion$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['countryCode']\"\r\n (change)=\"onCountrySelectedFacturacion($event.target.value)\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">\r\n {{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.countryCode.touched && checkoutFormFacturacion.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(provincesFacturacion$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelectedFacturacion($event.target.value)\"\r\n [formControl]=\"checkoutFormFacturacion.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option> -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">\r\n {{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.provinceCode.touched && checkoutFormFacturacion.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutFormFacturacion.controls['city']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.city.touched && checkoutFormFacturacion.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutFormFacturacion.controls['street']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"postcode\" [formControl]=\"checkoutFormFacturacion.controls['postcode']\"\r\n value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\">{{postalCodeErrorMessage |translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 5-->\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(documentTypesFacturacion$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentType']\"\r\n (change)=\"onDocumentTypesSelectedFacturacion($event.target.value)\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option> -->\r\n <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">\r\n {{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentType.touched && checkoutFormFacturacion.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" [type]=\"'text'\"\r\n name=\"documentNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'document-number-help'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <label class=\"field-label\"\r\n *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}aaa <span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelNotesHtml\">\r\n <div [innerHTML]=\"labelNotesHtml\"></div>\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span>\r\n </label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutFormFacturacion.controls['notes']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n\r\n\r\n <ng-template #template>\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modalRef.hide()\">\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"modal-body scrol-if\">\r\n <app-section-container-ec [name]=\"'terminos-y-condiciones'\"> </app-section-container-ec>\r\n </div>\r\n\r\n </ng-template>\r\n\r\n\r\n <ng-template #addressBookNotResult>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <h4> {{'address-book-not-result' | translate }} </h4>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #addressBookLoading>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<ng-template #pleaseLogin>\r\n <div class=\"container\">\r\n <p>Por favor <a [routerLink]=\"['/auth/login']\"> Inicie Sesi\u00F3n</a></p>\r\n </div>\r\n</ng-template>",
|
|
7231
|
+
template: "<ng-container *ngIf=\"this.channelConfig.channelType != 'b2b' || (this.channelConfig.channelType == 'b2b' && authService.isAuthenticated()); else pleaseLogin\">\r\n<ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'LOAD_ADDRESS_AND_SELECTION' && this.authService.isAuthenticated() && this.addressBook != null\">\r\n <div class=\"container card p-4 mb-3\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-10 col-lg-8 text-center\">\r\n <div class=\"btn-group btn-group-toggle\" data-bs-toggle=\"buttons\">\r\n <label [class]=\"'btn btn-outline-secondary ' + (!getMode() ? 'active' : '')\">\r\n <input type=\"radio\" name=\"options\" id=\"option1\" autocomplete=\"off\" checked\r\n (change)=\"setMode('seleccion')\"> {{'select-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (getMode() ? 'active' : '')\" *ngIf=\"!getParamByChannelAndLanguage('btn_new_address_')\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\" (change)=\"setMode('carga')\">\r\n {{ 'new-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (selectAddress ? 'active' : '')\" *ngIf=\"getParamByChannelAndLanguage('btn_new_address_') as param\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\" (change)=\"setMode('carga')\">\r\n {{ param.value}}\r\n </label>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"getMode(); else addressSelection\">\r\n <div *ngIf=\"!require_login; else requireLoginView\">\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_LOAD_ADDRESS'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'billing-details'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <form (submit)=\"verifyValidate(false,this.cartService.items)\">\r\n <div class=\"row mt-df\"><!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutForm.controls['firstName']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutForm.controls['lastName']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"phoneNumber\"\r\n [formControl]=\"checkoutForm.controls['phoneNumber']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutForm.controls['email']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 3-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(countries$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutForm.controls['countryCode']\"\r\n (change)=\"onCountrySelected($event.target.value)\">\r\n <!-- <option selected [value]=\"countries[0].code\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">{{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.countryCode.touched && checkoutForm.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(provinces$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['provinceCode']\">\r\n<!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option>\r\n --> <option *ngFor=\"let province of provinces\" [value]=\"province.code\">{{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.provinceCode.touched && checkoutForm.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutForm.controls['city']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.city.touched && checkoutForm.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutForm.controls['street']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n\r\n <!-- form direcci\u00F3n -->\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutForm.controls['postcode']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\"> {{postalCodeErrorMessage | translate}} </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypes$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n (change)=\"onDocumentTypesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['documentType']\">\r\n<!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option>\r\n --> <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentType.touched && checkoutForm.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\"\r\n [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutForm.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">{{ 'document-number-help' | translate }}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"><!--Fila 6-->\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\" [innerHTML]=\"labelnotes.value\"><span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutForm.controls['notes']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 7-->\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label for=\"formFact\"><b>{{ 'same-billing-address' | translate }}</b> <input type=\"checkbox\"\r\n class=\"ms-2\" [checked]=\"viewDataFacturacion\" (change)=\"showFormFacturacion()\"\r\n id=\"formFact\"></label>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"col-12\">\r\n <p>\r\n <!-- <span class=\"required\"></span> -->\r\n <label class=\"required text-underline\">* {{ 'required-fields' | translate }}</label>\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.enabled\">\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.required\"\r\n class=\"required\">*</span>\r\n <label class=\"\" for=\"\"> {{ 'accept-terms' | translate }} <input class=\"ms-2\" name=\"terms\"\r\n [formControl]=\"checkoutForm.controls['terms']\" type=\"checkbox\" required\r\n (change)=\"onInputChange()\" /> </label><br />\r\n <a (click)=\"openModal(template)\" role=\"button\" class=\"ms-3 nota-input text-dark\">{{ 'whats-this' |\r\n translate }}</a>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.terms.touched && !checkoutForm.controls.terms.value\">\r\n <span class=\"text-danger\">{{ 'must-accept-terms' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"viewDataFacturacion ; else datosFormFacturacion\"> </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button type=\"submit\" [disabled]=\"!validado\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}</button>\r\n\r\n\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template #addressSelection>\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_ADDRESS_SELECTION'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'address-selection'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"this.addressBook; else addressBookNotResult\">\r\n\r\n <ng-container *ngIf=\"this.addressBook?.length ;else addressBookLoading\">\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-6 col-12 my-3\" *ngFor=\"let item of addressBook; let i = index\">\r\n <div class=\"card p-3\">\r\n <input class=\"ms-1 mt-3 form-check-input input-size-lg\" type=\"radio\" [name]=\"'n-'+i\" [id]=\"i\"\r\n [checked]=\"item.selected\" (click)=\"setSelectAddress(item)\" (change)=\"onInputChange()\">\r\n <div class=\"ms-5\">\r\n <h4 class=\"card-title\">\r\n <strong>{{'address'|translate}}</strong><br>\r\n <span class=\"text-uppercase h3\">{{item.street}}</span>\r\n </h4>\r\n <div class=\"row\">\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'country'|translate}}</strong> {{getCountry(item.countryCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'state'|translate}}</strong> {{getProvince(item.provinceCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'town-city'|translate}}</strong> {{item.city}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'postal-code'|translate}}</strong> {{item.postcode}}\r\n </h5>\r\n </div>\r\n <div class=\"row px-3\">\r\n <div class=\"card p-2 bg-light w-100\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">{{'address-contact'|translate}}</h5>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'first-name'|translate}}</strong>\r\n {{item.addressContact.firstName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'last-name'|translate}}</strong> {{item.addressContact.lastName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-type'|translate}}</strong>\r\n {{getDocumentType(item.addressContact.documentType)}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-number'|translate}}</strong>\r\n {{item.addressContact.documentNumber}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'email-address'|translate}}</strong> {{item.addressContact.email}}\r\n </h6>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n<!-- Se hardcodea el canal de mundo del juguete empresa A ya que se necesita con urgencia, se sustituira por un campo que llegara de backend. -->\r\n <div class=\"w-100\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"> \r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\"\r\n *ngIf=\"getLabelNotesParam() as labelnotes\" [innerHTML]=\"labelnotes.value\"></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [(ngModel)]=\"this.addressBookSelected.notes\" #ctrl=\"ngModel\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\"> \r\n <div class=\"invalid-feedback d-block\" *ngIf=\"\r\n addressingService.getTypeForm().viewForms.notes.required\r\n && (!addressBookSelected.notes || !addressBookSelected.notes.trim())\r\n \">\r\n {{ 'required-field' | translate }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button (click)=\"selectAddress(this.cartService.items)\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}\r\n </button>\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n</ng-template>\r\n\r\n\r\n<ng-template #requireLoginView>\r\n <div id=\"loginCheckout\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\" *ngIf=\"require_login\">\r\n <div class=\"col-12\">\r\n <app-login-form-ec (ready)=\"verifyValidate($event)\" [redirect]=\"false\" [title]=\"'need-login'\">\r\n </app-login-form-ec>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n<ng-template #datosFormFacturacion>\r\n <div class=\"container-fluid px-0 px-md-2\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card \">\r\n <div class=\"card-header text-dark text-center\">\r\n <h3>{{'billing-data'|translate}}</h3>\r\n </div>\r\n <div class=\"card-body\">\r\n <form (submit)=\"verifyValidate()\">\r\n <div class=\"row mt-df\">\r\n <!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['firstName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['lastName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"phoneNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['phoneNumber']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutFormFacturacion.controls['email']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 3-->\r\n\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(countriesFacturacion$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['countryCode']\"\r\n (change)=\"onCountrySelectedFacturacion($event.target.value)\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">\r\n {{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.countryCode.touched && checkoutFormFacturacion.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(provincesFacturacion$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelectedFacturacion($event.target.value)\"\r\n [formControl]=\"checkoutFormFacturacion.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option> -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">\r\n {{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.provinceCode.touched && checkoutFormFacturacion.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutFormFacturacion.controls['city']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.city.touched && checkoutFormFacturacion.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutFormFacturacion.controls['street']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['postcode']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\">{{postalCodeErrorMessage |translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypesFacturacion$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentType']\"\r\n (change)=\"onDocumentTypesSelectedFacturacion($event.target.value)\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option> -->\r\n <option\r\n *ngFor=\"let item of documentTypes\"\r\n [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentType.touched && checkoutFormFacturacion.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\"\r\n [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'document-number-help'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}aaa <span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelNotesHtml\">\r\n <div [innerHTML]=\"labelNotesHtml\"></div>\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span>\r\n </label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutFormFacturacion.controls['notes']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n<ng-template #template>\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modalRef.hide()\">\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"modal-body scrol-if\">\r\n <app-section-container-ec [name]=\"'terminos-y-condiciones'\"> </app-section-container-ec>\r\n </div>\r\n\r\n</ng-template>\r\n\r\n\r\n<ng-template #addressBookNotResult>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <h4> {{'address-book-not-result' | translate }} </h4>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #addressBookLoading>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n</ng-container>\r\n\r\n<ng-template #pleaseLogin>\r\n <div class=\"container\">\r\n <p>Por favor <a [routerLink]=\"['/auth/login']\" > Inicie Sesi\u00F3n</a></p>\r\n </div>\r\n</ng-template>",
|
|
7260
7232
|
providers: [BsModalService],
|
|
7261
7233
|
styles: [".mt-df{margin:10px auto 0}.btn.btn-outline-secondary.active,.btn.btn-outline-secondary:hover{color:#fff!important}.required{color:red}.field-label{color:#000}.btn.valid-btn{background-color:#000;color:#fff;margin-right:-3px;margin-bottom:10px}label{color:#000}.input-size-lg{width:1.8rem;height:1.8rem}"]
|
|
7262
7234
|
})
|
|
@@ -7676,8 +7648,12 @@ var __decorate$V = (this && this.__decorate) || function (decorators, target, ke
|
|
|
7676
7648
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7677
7649
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7678
7650
|
};
|
|
7679
|
-
|
|
7680
|
-
|
|
7651
|
+
var __param$7 = (this && this.__param) || function (paramIndex, decorator) {
|
|
7652
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
7653
|
+
};
|
|
7654
|
+
var CollectionEcComponent_1;
|
|
7655
|
+
let CollectionEcComponent = CollectionEcComponent_1 = class CollectionEcComponent extends ComponentHelper {
|
|
7656
|
+
constructor(productsService, paramsSrv, activeRoute, optionsService, authService, analyticsService, cartService, consts, filtersService, router, platformId) {
|
|
7681
7657
|
super();
|
|
7682
7658
|
this.productsService = productsService;
|
|
7683
7659
|
this.paramsSrv = paramsSrv;
|
|
@@ -7688,12 +7664,21 @@ let CollectionEcComponent = class CollectionEcComponent extends ComponentHelper
|
|
|
7688
7664
|
this.cartService = cartService;
|
|
7689
7665
|
this.consts = consts;
|
|
7690
7666
|
this.filtersService = filtersService;
|
|
7667
|
+
this.router = router;
|
|
7691
7668
|
this.filters = [];
|
|
7692
7669
|
this.filtersConfig = { filters: [] };
|
|
7693
7670
|
this.finished = false;
|
|
7694
7671
|
this.loading = true;
|
|
7695
7672
|
this.breadcrumb = [];
|
|
7696
7673
|
this.isCollection = true;
|
|
7674
|
+
this.usingCachedProducts = false;
|
|
7675
|
+
this.allCachedProducts = [];
|
|
7676
|
+
this.subscriptionsConfigured = false;
|
|
7677
|
+
this.isScrolling = false;
|
|
7678
|
+
this.pendingScrollPosition = null;
|
|
7679
|
+
this.expectedProductCount = 0;
|
|
7680
|
+
this.filtersFromCache = false; // Flag para indicar si los filtros vienen del cache
|
|
7681
|
+
this.isCategoryChange = false; // Flag para indicar si es un cambio de categoría
|
|
7697
7682
|
this.productsWithUniqueVariant = false;
|
|
7698
7683
|
this.optionsFilters = ['all'];
|
|
7699
7684
|
/**
|
|
@@ -7762,23 +7747,113 @@ let CollectionEcComponent = class CollectionEcComponent extends ComponentHelper
|
|
|
7762
7747
|
this.getObjectWithVariant = () => {
|
|
7763
7748
|
return this.consts.getParamsProductsWithUniqueVariant();
|
|
7764
7749
|
};
|
|
7750
|
+
// Método personalizado para manejar selección de filtros que invalidará cache
|
|
7751
|
+
this.customSetFilterSelected = (filter, filterElement) => {
|
|
7752
|
+
// Invalidar cache completamente cuando se selecciona un filtro
|
|
7753
|
+
this.usingCachedProducts = false;
|
|
7754
|
+
this.allCachedProducts = [];
|
|
7755
|
+
this.filtersFromCache = false; // Ya no usamos filtros del cache
|
|
7756
|
+
this.isCategoryChange = true; // Marcar como cambio para reemplazar productos
|
|
7757
|
+
CollectionEcComponent_1.stateCache.delete(this.stateKey);
|
|
7758
|
+
console.log('🔄 Filtro seleccionado, invalidando cache y recargando desde endpoint para:', this.stateKey);
|
|
7759
|
+
// Solo limpiar productos, NO limpiar filtros para que no desaparezcan
|
|
7760
|
+
this.products = [];
|
|
7761
|
+
this.loading = true;
|
|
7762
|
+
// Llamar al método original del ProductsService que iniciará una carga completa
|
|
7763
|
+
const result = this.productsService.setFilterSelected(filter, filterElement);
|
|
7764
|
+
// La suscripción principal automáticamente actualizará los filtros
|
|
7765
|
+
// porque filtersFromCache = false y usingCachedProducts = false
|
|
7766
|
+
return result;
|
|
7767
|
+
};
|
|
7765
7768
|
this.paramsSrv.parameters.subscribe(param => this.params = param);
|
|
7766
7769
|
this.defaultFilters = this.consts.getDefaultFilters();
|
|
7767
7770
|
this.filtersConfig.filters = this.consts.getFilterConfig();
|
|
7768
7771
|
this.productsService.filtersInView$.subscribe(res => this.filterInView = res);
|
|
7772
|
+
// Inicializar propiedades de scroll y cache
|
|
7773
|
+
this.platformId = platformId;
|
|
7774
|
+
this.isRestoringState = false;
|
|
7775
|
+
this.usingCachedProducts = false;
|
|
7776
|
+
this.allCachedProducts = [];
|
|
7777
|
+
this.subscriptionsConfigured = false;
|
|
7778
|
+
this.isScrolling = false;
|
|
7779
|
+
this.pendingScrollPosition = null;
|
|
7780
|
+
this.expectedProductCount = 0;
|
|
7781
|
+
this.filtersFromCache = false;
|
|
7769
7782
|
this.ecOnConstruct();
|
|
7770
7783
|
}
|
|
7771
7784
|
ngOnInit() {
|
|
7772
|
-
|
|
7773
|
-
|
|
7774
|
-
this.
|
|
7775
|
-
|
|
7785
|
+
this.stateKey = this.router.url.split('?')[0];
|
|
7786
|
+
// Verificar si hay estado guardado ANTES de scroll(0,0)
|
|
7787
|
+
const savedState = CollectionEcComponent_1.stateCache.get(this.stateKey);
|
|
7788
|
+
if (savedState && savedState.products.length > 0) {
|
|
7789
|
+
// NO llamar window.scroll(0, 0) para preservar posición
|
|
7790
|
+
this.products = [];
|
|
7791
|
+
this.ecOnInit();
|
|
7792
|
+
this.getProductsAndSubscribe(); // Llamar directamente
|
|
7793
|
+
}
|
|
7794
|
+
else {
|
|
7795
|
+
// Comportamiento normal con scroll al inicio
|
|
7796
|
+
window.scroll(0, 0);
|
|
7797
|
+
this.products = [];
|
|
7798
|
+
this.ecOnInit();
|
|
7799
|
+
this.getProductsAndSubscribe();
|
|
7800
|
+
}
|
|
7801
|
+
// Configurar manejo de estado
|
|
7802
|
+
this.setupBeforeUnloadHandler();
|
|
7776
7803
|
}
|
|
7777
7804
|
getProductsAndSubscribe() {
|
|
7805
|
+
// Verificar PRIMERO si hay estado guardado
|
|
7806
|
+
const savedState = CollectionEcComponent_1.stateCache.get(this.stateKey);
|
|
7807
|
+
if (savedState && savedState.products.length > 0) {
|
|
7808
|
+
console.log('📦 Restaurando desde cache:', savedState.products.length, 'productos');
|
|
7809
|
+
// Configurar modo cache ANTES de restaurar
|
|
7810
|
+
this.usingCachedProducts = true;
|
|
7811
|
+
this.allCachedProducts = [...savedState.products];
|
|
7812
|
+
this.isRestoringState = true;
|
|
7813
|
+
// Restaurar productos inmediatamente
|
|
7814
|
+
this.products = [...savedState.products];
|
|
7815
|
+
this.finished = savedState.finished;
|
|
7816
|
+
this.loading = false;
|
|
7817
|
+
// Restaurar filtros si están disponibles
|
|
7818
|
+
if (savedState.filters) {
|
|
7819
|
+
this.filters = [...savedState.filters];
|
|
7820
|
+
this.filtersFromCache = true; // Marcar que estos filtros vienen del cache
|
|
7821
|
+
console.log('📦 Filtros restaurados desde cache:', this.filters.length);
|
|
7822
|
+
}
|
|
7823
|
+
if (savedState.filters_top) {
|
|
7824
|
+
this.filters_top = [...savedState.filters_top];
|
|
7825
|
+
console.log('📦 Filtros top restaurados desde cache:', this.filters_top.length);
|
|
7826
|
+
}
|
|
7827
|
+
if (savedState.breadcrumb) {
|
|
7828
|
+
this.breadcrumb = [...savedState.breadcrumb];
|
|
7829
|
+
console.log('📦 Breadcrumb restaurado desde cache:', this.breadcrumb);
|
|
7830
|
+
}
|
|
7831
|
+
// IMPORTANTE: Configurar TODAS las suscripciones del padre (filtros, breadcrumb, etc.)
|
|
7832
|
+
// pero SIN resetear productos ni hacer petición inicial
|
|
7833
|
+
this.setupParentSubscriptionsOnly();
|
|
7834
|
+
// Configurar suscripción personalizada para detectar cambios de categoría
|
|
7835
|
+
this.setupCustomSubscription();
|
|
7836
|
+
this.subscriptionsConfigured = true;
|
|
7837
|
+
// Restaurar scroll después de que los productos se rendericen
|
|
7838
|
+
this.waitForProductRendering(savedState.scrollPosition);
|
|
7839
|
+
return;
|
|
7840
|
+
}
|
|
7841
|
+
console.log('🔄 No hay cache, carga normal');
|
|
7842
|
+
// Si no hay estado guardado, comportamiento normal
|
|
7843
|
+
this.usingCachedProducts = false;
|
|
7844
|
+
this.allCachedProducts = [];
|
|
7845
|
+
this.filtersFromCache = false; // No hay filtros del cache
|
|
7846
|
+
// Llamar al comportamiento original
|
|
7847
|
+
this.originalGetProductsAndSubscribe();
|
|
7848
|
+
this.subscriptionsConfigured = true;
|
|
7849
|
+
}
|
|
7850
|
+
originalGetProductsAndSubscribe() {
|
|
7778
7851
|
combineLatest([this.activeRoute.params, this.optionsService.ready, this.activeRoute.queryParams]).subscribe(([params, ready, queryParams]) => {
|
|
7779
7852
|
if (ready.readyAll) {
|
|
7780
7853
|
let cambio = false;
|
|
7781
7854
|
this.products = [];
|
|
7855
|
+
// Marcar como cambio de categoría para la carga inicial
|
|
7856
|
+
this.isCategoryChange = true;
|
|
7782
7857
|
if (!params['type'] || !params['value']) {
|
|
7783
7858
|
this.productsService.getProductsForFilter({ latest: true, limit: 10 }, this.optionsFilters, queryParams.search, this.defaultFilters);
|
|
7784
7859
|
}
|
|
@@ -7808,7 +7883,16 @@ let CollectionEcComponent = class CollectionEcComponent extends ComponentHelper
|
|
|
7808
7883
|
}
|
|
7809
7884
|
else {
|
|
7810
7885
|
res = this.productsService.getProductsWithUniqueVariant(res, this.getObjectWithVariant());
|
|
7811
|
-
|
|
7886
|
+
// Filtrar productos duplicados antes de agregar
|
|
7887
|
+
const existingIds = new Set(this.products.map(p => p.id));
|
|
7888
|
+
const uniqueProducts = res.filter(p => !existingIds.has(p.id));
|
|
7889
|
+
if (uniqueProducts.length > 0) {
|
|
7890
|
+
console.log('➕ CollectionEC (variants): Agregando', uniqueProducts.length, 'de', res.length, 'productos únicos');
|
|
7891
|
+
this.products.push(...uniqueProducts);
|
|
7892
|
+
}
|
|
7893
|
+
else {
|
|
7894
|
+
console.log('⚠️ CollectionEC (variants): Todos los productos ya existen - ignorando', res.length, 'productos');
|
|
7895
|
+
}
|
|
7812
7896
|
this.applyFiltersInView();
|
|
7813
7897
|
}
|
|
7814
7898
|
;
|
|
@@ -7820,7 +7904,16 @@ let CollectionEcComponent = class CollectionEcComponent extends ComponentHelper
|
|
|
7820
7904
|
cambio = false;
|
|
7821
7905
|
}
|
|
7822
7906
|
else {
|
|
7823
|
-
|
|
7907
|
+
// Filtrar productos duplicados antes de agregar
|
|
7908
|
+
const existingIds = new Set(this.products.map(p => p.id));
|
|
7909
|
+
const uniqueProducts = res.filter(p => !existingIds.has(p.id));
|
|
7910
|
+
if (uniqueProducts.length > 0) {
|
|
7911
|
+
console.log('➕ CollectionEC: Agregando', uniqueProducts.length, 'de', res.length, 'productos únicos');
|
|
7912
|
+
this.products.push(...uniqueProducts);
|
|
7913
|
+
}
|
|
7914
|
+
else {
|
|
7915
|
+
console.log('⚠️ CollectionEC: Todos los productos ya existen - ignorando', res.length, 'productos');
|
|
7916
|
+
}
|
|
7824
7917
|
this.applyFiltersInView();
|
|
7825
7918
|
}
|
|
7826
7919
|
}
|
|
@@ -7837,6 +7930,141 @@ let CollectionEcComponent = class CollectionEcComponent extends ComponentHelper
|
|
|
7837
7930
|
}
|
|
7838
7931
|
});
|
|
7839
7932
|
}
|
|
7933
|
+
setupParentSubscriptionsOnly() {
|
|
7934
|
+
var _a;
|
|
7935
|
+
// Desuscribir cualquier suscripción anterior
|
|
7936
|
+
try {
|
|
7937
|
+
(_a = this.suscripcion) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
7938
|
+
}
|
|
7939
|
+
catch (e) { }
|
|
7940
|
+
// IMPORTANTE: Configurar suscripción a productos para navegación posterior
|
|
7941
|
+
this.suscripcion = this.productsService.products$.subscribe(res => {
|
|
7942
|
+
var _a;
|
|
7943
|
+
console.log('📦 Suscripción products$ (desde cache):', (_a = res) === null || _a === void 0 ? void 0 : _a.length, 'productos');
|
|
7944
|
+
this.loading = false;
|
|
7945
|
+
if (res && res.length > 0) {
|
|
7946
|
+
// Si estamos usando cache, agregar solo productos nuevos únicos
|
|
7947
|
+
if (this.usingCachedProducts) {
|
|
7948
|
+
const existingIds = new Set(this.products.map(p => p.id));
|
|
7949
|
+
const uniqueProducts = res.filter(p => !existingIds.has(p.id));
|
|
7950
|
+
if (uniqueProducts.length > 0) {
|
|
7951
|
+
console.log('➕ Cache: Agregando', uniqueProducts.length, 'productos adicionales');
|
|
7952
|
+
this.products.push(...uniqueProducts);
|
|
7953
|
+
this.usingCachedProducts = false; // Ya no solo cache
|
|
7954
|
+
}
|
|
7955
|
+
}
|
|
7956
|
+
else {
|
|
7957
|
+
// Determinar si es cambio de categoría o scroll infinito
|
|
7958
|
+
if (this.isCategoryChange) {
|
|
7959
|
+
// Cambio de categoría: reemplazar completamente
|
|
7960
|
+
console.log('🔄 Cambio de categoría: Reemplazando productos completamente');
|
|
7961
|
+
if (this.productsWithUniqueVariant) {
|
|
7962
|
+
this.products = this.productsService.getProductsWithUniqueVariant(res, this.getObjectWithVariant());
|
|
7963
|
+
}
|
|
7964
|
+
else {
|
|
7965
|
+
this.products = res;
|
|
7966
|
+
}
|
|
7967
|
+
this.applyFiltersInView();
|
|
7968
|
+
this.isCategoryChange = false; // Resetear bandera
|
|
7969
|
+
}
|
|
7970
|
+
else {
|
|
7971
|
+
// Scroll infinito: agregar productos únicos
|
|
7972
|
+
console.log('📜 Scroll infinito: Agregando productos únicos');
|
|
7973
|
+
const existingIds = new Set(this.products.map(p => p.id));
|
|
7974
|
+
let newProducts = res;
|
|
7975
|
+
if (this.productsWithUniqueVariant) {
|
|
7976
|
+
newProducts = this.productsService.getProductsWithUniqueVariant(res, this.getObjectWithVariant());
|
|
7977
|
+
}
|
|
7978
|
+
const uniqueProducts = newProducts.filter(p => !existingIds.has(p.id));
|
|
7979
|
+
if (uniqueProducts.length > 0) {
|
|
7980
|
+
console.log('➕ Agregando', uniqueProducts.length, 'productos únicos por scroll');
|
|
7981
|
+
this.products.push(...uniqueProducts);
|
|
7982
|
+
}
|
|
7983
|
+
else {
|
|
7984
|
+
console.log('⚠️ Todos los productos del scroll ya existen');
|
|
7985
|
+
}
|
|
7986
|
+
this.applyFiltersInView();
|
|
7987
|
+
}
|
|
7988
|
+
}
|
|
7989
|
+
}
|
|
7990
|
+
else if (res && res.length === 0) {
|
|
7991
|
+
// Si recibimos array vacío y no estamos usando cache, limpiar productos
|
|
7992
|
+
if (!this.usingCachedProducts) {
|
|
7993
|
+
this.products = [];
|
|
7994
|
+
}
|
|
7995
|
+
}
|
|
7996
|
+
this.finished = this.productsService.isFinished();
|
|
7997
|
+
this.analyticsService.callEvent('view_item_list', { products: this.products, item_list_name: 'Collection', item_list_id: 0 });
|
|
7998
|
+
});
|
|
7999
|
+
// Configurar suscripciones de filtros
|
|
8000
|
+
this.productsService.filters$.subscribe(res => {
|
|
8001
|
+
// IMPORTANTE: Solo actualizar filtros si NO vienen del cache
|
|
8002
|
+
if (!this.filtersFromCache) {
|
|
8003
|
+
console.log('🔄 Actualizando filtros desde server');
|
|
8004
|
+
this.breadcrumb = this.optionsService.getBreadcrumbByFilters(res);
|
|
8005
|
+
this.filters = this.getSpecificFilters(res, this.filtersConfig.filters);
|
|
8006
|
+
this.filters_top = this.getSpecificFilters(res, ['sort']);
|
|
8007
|
+
}
|
|
8008
|
+
else {
|
|
8009
|
+
console.log('🚫 Saltando actualización de filtros (usando cache)');
|
|
8010
|
+
// Una vez que han sido utilizados, resetear el flag
|
|
8011
|
+
this.filtersFromCache = false;
|
|
8012
|
+
}
|
|
8013
|
+
});
|
|
8014
|
+
this.productsService.finished().subscribe(res => this.finished = res);
|
|
8015
|
+
}
|
|
8016
|
+
setupCustomSubscription() {
|
|
8017
|
+
// Suscripción personalizada para detectar cambios de categoría/búsqueda
|
|
8018
|
+
combineLatest([this.activeRoute.params, this.optionsService.ready, this.activeRoute.queryParams]).subscribe(([params, ready, queryParams]) => {
|
|
8019
|
+
if (ready.readyAll && this.subscriptionsConfigured) {
|
|
8020
|
+
const currentKey = this.generateStateKey();
|
|
8021
|
+
// Si la clave cambió, significa que navegamos a una categoría diferente
|
|
8022
|
+
if (currentKey !== this.stateKey) {
|
|
8023
|
+
console.log('🔄 Cambio de categoría detectado, invalidando cache y recargando');
|
|
8024
|
+
this.stateKey = currentKey;
|
|
8025
|
+
// Limpiar cache y recargar normalmente
|
|
8026
|
+
this.invalidateCache();
|
|
8027
|
+
this.usingCachedProducts = false;
|
|
8028
|
+
this.allCachedProducts = [];
|
|
8029
|
+
this.filtersFromCache = false;
|
|
8030
|
+
// IMPORTANTE: Marcar que es cambio de categoría y resetear estado
|
|
8031
|
+
this.isCategoryChange = true;
|
|
8032
|
+
this.loading = true;
|
|
8033
|
+
this.products = [];
|
|
8034
|
+
// Recargar normalmente - pero solo la petición, no reconfigurar suscripciones
|
|
8035
|
+
this.loadNewCategory(params, queryParams);
|
|
8036
|
+
}
|
|
8037
|
+
}
|
|
8038
|
+
});
|
|
8039
|
+
}
|
|
8040
|
+
loadNewCategory(params, queryParams) {
|
|
8041
|
+
// Hacer solo la petición de productos sin reconfigurar todas las suscripciones
|
|
8042
|
+
let cambio = false;
|
|
8043
|
+
if (!params['type'] || !params['value']) {
|
|
8044
|
+
this.productsService.getProductsForFilter({ latest: true, limit: 10 }, this.optionsFilters, queryParams.search, this.defaultFilters);
|
|
8045
|
+
}
|
|
8046
|
+
else {
|
|
8047
|
+
this.productsService.getProductsForFilter({ type: params.type, value: params.value }, this.optionsFilters, queryParams.search, this.defaultFilters);
|
|
8048
|
+
cambio = true;
|
|
8049
|
+
this.type = params['type'];
|
|
8050
|
+
this.value = params['value'];
|
|
8051
|
+
}
|
|
8052
|
+
console.log('🔄 Nueva petición enviada para categoría:', params.type, params.value);
|
|
8053
|
+
}
|
|
8054
|
+
generateStateKey() {
|
|
8055
|
+
// Incluir ruta y parámetros para generar clave única
|
|
8056
|
+
const route = this.router.url.split('?')[0]; // Sin query params
|
|
8057
|
+
const params = this.activeRoute.snapshot.params;
|
|
8058
|
+
return `${route}_${JSON.stringify(params)}`;
|
|
8059
|
+
}
|
|
8060
|
+
invalidateCache() {
|
|
8061
|
+
// Limpiar cache específico y sessionStorage
|
|
8062
|
+
console.log('🗑️ Invalidando cache para:', this.stateKey);
|
|
8063
|
+
CollectionEcComponent_1.stateCache.delete(this.stateKey);
|
|
8064
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
8065
|
+
sessionStorage.removeItem(`collection_scroll_${this.stateKey}`);
|
|
8066
|
+
}
|
|
8067
|
+
}
|
|
7840
8068
|
onScroll() {
|
|
7841
8069
|
this.loading = true;
|
|
7842
8070
|
if (!this.productsService.isWaiting() && !this.productsService.getNext()) {
|
|
@@ -7844,7 +8072,183 @@ let CollectionEcComponent = class CollectionEcComponent extends ComponentHelper
|
|
|
7844
8072
|
this.loading = false;
|
|
7845
8073
|
}
|
|
7846
8074
|
}
|
|
8075
|
+
// Métodos de ciclo de vida requeridos
|
|
8076
|
+
ngAfterViewChecked() {
|
|
8077
|
+
// Solo verificar si hay un scroll pendiente
|
|
8078
|
+
if (this.pendingScrollPosition !== null && isPlatformBrowser(this.platformId)) {
|
|
8079
|
+
const productElements = document.querySelectorAll('.col-lg-3, .col-md-4, .col-6, [class*="product"], .product-item, .card');
|
|
8080
|
+
const currentProductCount = productElements.length;
|
|
8081
|
+
// Verificar si se han renderizado suficientes productos
|
|
8082
|
+
if (currentProductCount >= Math.min(this.expectedProductCount, 10)) {
|
|
8083
|
+
const targetPosition = this.pendingScrollPosition;
|
|
8084
|
+
this.pendingScrollPosition = null; // Limpiar para evitar loops
|
|
8085
|
+
// Usar requestAnimationFrame para asegurar que el rendering esté completo
|
|
8086
|
+
requestAnimationFrame(() => {
|
|
8087
|
+
requestAnimationFrame(() => {
|
|
8088
|
+
this.restoreScrollWithRetries(targetPosition);
|
|
8089
|
+
this.isRestoringState = false;
|
|
8090
|
+
});
|
|
8091
|
+
});
|
|
8092
|
+
}
|
|
8093
|
+
}
|
|
8094
|
+
}
|
|
8095
|
+
ngOnDestroy() {
|
|
8096
|
+
var _a;
|
|
8097
|
+
(_a = this.routerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
8098
|
+
this.saveCurrentState();
|
|
8099
|
+
// Limpiar scroll pendiente
|
|
8100
|
+
this.pendingScrollPosition = null;
|
|
8101
|
+
// Limpiar event listeners
|
|
8102
|
+
if (this.clickHandler) {
|
|
8103
|
+
document.removeEventListener('click', this.clickHandler);
|
|
8104
|
+
}
|
|
8105
|
+
}
|
|
8106
|
+
// Métodos de manejo de scroll y cache
|
|
8107
|
+
setupBeforeUnloadHandler() {
|
|
8108
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
8109
|
+
// Interceptar clics en productos para guardar estado
|
|
8110
|
+
this.clickHandler = (event) => {
|
|
8111
|
+
const target = event.target;
|
|
8112
|
+
// Buscar si el clic es en un enlace a producto
|
|
8113
|
+
const link = target.closest('a[href*="/product/"]');
|
|
8114
|
+
if (link && this.router.url.includes('/collection/')) {
|
|
8115
|
+
console.log('🎯 Clic en producto detectado, guardando estado');
|
|
8116
|
+
this.saveCurrentState();
|
|
8117
|
+
}
|
|
8118
|
+
};
|
|
8119
|
+
document.addEventListener('click', this.clickHandler);
|
|
8120
|
+
// Guardar durante scroll en la página de colección
|
|
8121
|
+
let scrollTimer;
|
|
8122
|
+
window.addEventListener('scroll', () => {
|
|
8123
|
+
// Solo guardar si estamos en una página de colección
|
|
8124
|
+
if (this.router.url.includes('/collection/')) {
|
|
8125
|
+
clearTimeout(scrollTimer);
|
|
8126
|
+
scrollTimer = setTimeout(() => this.saveCurrentState(), 300);
|
|
8127
|
+
}
|
|
8128
|
+
});
|
|
8129
|
+
// Guardar antes de que el usuario salga de la página
|
|
8130
|
+
window.addEventListener('beforeunload', () => {
|
|
8131
|
+
if (this.router.url.includes('/collection/')) {
|
|
8132
|
+
this.saveCurrentState();
|
|
8133
|
+
}
|
|
8134
|
+
});
|
|
8135
|
+
}
|
|
8136
|
+
}
|
|
8137
|
+
saveCurrentState() {
|
|
8138
|
+
if (isPlatformBrowser(this.platformId) && this.products && this.products.length > 0) {
|
|
8139
|
+
// Obtener posición de scroll de múltiples fuentes
|
|
8140
|
+
const scrollPos = Math.max(window.pageYOffset || 0, document.documentElement.scrollTop || 0, document.body.scrollTop || 0);
|
|
8141
|
+
// Solo guardar si tenemos una posición significativa o productos suficientes
|
|
8142
|
+
if (scrollPos > 10 || this.products.length > 10) {
|
|
8143
|
+
const state = {
|
|
8144
|
+
products: [...this.products],
|
|
8145
|
+
scrollPosition: scrollPos,
|
|
8146
|
+
finished: this.finished,
|
|
8147
|
+
loading: this.loading,
|
|
8148
|
+
page: Math.ceil(this.products.length / 10),
|
|
8149
|
+
allCachedProducts: this.usingCachedProducts ? [...this.allCachedProducts] : [...this.products],
|
|
8150
|
+
filters: this.filters ? [...this.filters] : undefined,
|
|
8151
|
+
filters_top: this.filters_top ? [...this.filters_top] : undefined,
|
|
8152
|
+
breadcrumb: this.breadcrumb ? [...this.breadcrumb] : undefined
|
|
8153
|
+
};
|
|
8154
|
+
CollectionEcComponent_1.stateCache.set(this.stateKey, state);
|
|
8155
|
+
// También guardar en sessionStorage como backup
|
|
8156
|
+
try {
|
|
8157
|
+
sessionStorage.setItem(`collection_scroll_${this.stateKey}`, scrollPos.toString());
|
|
8158
|
+
sessionStorage.setItem(`collection_products_${this.stateKey}`, this.products.length.toString());
|
|
8159
|
+
}
|
|
8160
|
+
catch (e) { }
|
|
8161
|
+
}
|
|
8162
|
+
}
|
|
8163
|
+
}
|
|
8164
|
+
restoreScrollWithRetries(targetPosition) {
|
|
8165
|
+
if (this.isScrolling) {
|
|
8166
|
+
return;
|
|
8167
|
+
}
|
|
8168
|
+
// Verificar si el target es mayor que la altura del documento
|
|
8169
|
+
const documentHeight = document.documentElement.scrollHeight;
|
|
8170
|
+
if (targetPosition > documentHeight) {
|
|
8171
|
+
targetPosition = Math.max(0, documentHeight - window.innerHeight);
|
|
8172
|
+
}
|
|
8173
|
+
// Solo verificar si el usuario ha hecho scroll muy lejos
|
|
8174
|
+
const currentPos = window.pageYOffset || document.documentElement.scrollTop;
|
|
8175
|
+
if (currentPos > 500 && Math.abs(currentPos - targetPosition) > 1000) {
|
|
8176
|
+
return;
|
|
8177
|
+
}
|
|
8178
|
+
this.isScrolling = true;
|
|
8179
|
+
// Intentar encontrar una posición más precisa basada en elementos del DOM
|
|
8180
|
+
const improvedPosition = this.tryScrollToProductByIndex(targetPosition);
|
|
8181
|
+
if (improvedPosition !== targetPosition) {
|
|
8182
|
+
targetPosition = improvedPosition;
|
|
8183
|
+
}
|
|
8184
|
+
let attempts = 0;
|
|
8185
|
+
const maxAttempts = 15;
|
|
8186
|
+
const tryScroll = () => {
|
|
8187
|
+
attempts++;
|
|
8188
|
+
// Usar scroll más agresivo si es necesario
|
|
8189
|
+
if (attempts < 3) {
|
|
8190
|
+
// Primeros intentos con smooth
|
|
8191
|
+
window.scrollTo({
|
|
8192
|
+
top: targetPosition,
|
|
8193
|
+
behavior: 'smooth'
|
|
8194
|
+
});
|
|
8195
|
+
}
|
|
8196
|
+
else {
|
|
8197
|
+
// Intentos posteriores más directos
|
|
8198
|
+
window.scrollTo(0, targetPosition);
|
|
8199
|
+
document.documentElement.scrollTop = targetPosition;
|
|
8200
|
+
document.body.scrollTop = targetPosition;
|
|
8201
|
+
}
|
|
8202
|
+
// Verificar después de un momento
|
|
8203
|
+
setTimeout(() => {
|
|
8204
|
+
const currentPos = window.pageYOffset || document.documentElement.scrollTop;
|
|
8205
|
+
const difference = Math.abs(currentPos - targetPosition);
|
|
8206
|
+
if (difference > 50 && attempts < maxAttempts) {
|
|
8207
|
+
const delay = attempts < 5 ? 100 : attempts < 10 ? 200 : 300;
|
|
8208
|
+
setTimeout(tryScroll, delay);
|
|
8209
|
+
}
|
|
8210
|
+
else {
|
|
8211
|
+
this.isScrolling = false; // Liberar flag cuando termine
|
|
8212
|
+
}
|
|
8213
|
+
}, 100);
|
|
8214
|
+
};
|
|
8215
|
+
// Intentar solo una vez inicialmente
|
|
8216
|
+
tryScroll();
|
|
8217
|
+
}
|
|
8218
|
+
tryScrollToProductByIndex(targetPosition) {
|
|
8219
|
+
// Intentar calcular a qué producto corresponde la posición
|
|
8220
|
+
const approximateIndex = Math.floor(targetPosition / 400); // Asumiendo ~400px por producto
|
|
8221
|
+
// Buscar elementos de producto
|
|
8222
|
+
const productElements = document.querySelectorAll('.col-lg-3, .col-md-4, .col-6, [class*="product"], .product-item, .card');
|
|
8223
|
+
if (productElements.length > approximateIndex && approximateIndex >= 0) {
|
|
8224
|
+
const targetElement = productElements[approximateIndex];
|
|
8225
|
+
const elementPosition = targetElement.offsetTop;
|
|
8226
|
+
// Usar la posición del elemento si es razonable
|
|
8227
|
+
if (Math.abs(elementPosition - targetPosition) < 800) {
|
|
8228
|
+
return elementPosition;
|
|
8229
|
+
}
|
|
8230
|
+
}
|
|
8231
|
+
return targetPosition; // Usar posición original si no encuentra elemento adecuado
|
|
8232
|
+
}
|
|
8233
|
+
waitForProductRendering(targetPosition) {
|
|
8234
|
+
var _a;
|
|
8235
|
+
// Configurar el scroll pendiente para que ngAfterViewChecked lo maneje
|
|
8236
|
+
this.pendingScrollPosition = targetPosition;
|
|
8237
|
+
this.expectedProductCount = ((_a = this.products) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
8238
|
+
// Timeout de seguridad en caso de que ngAfterViewChecked no se ejecute
|
|
8239
|
+
setTimeout(() => {
|
|
8240
|
+
if (this.pendingScrollPosition !== null) {
|
|
8241
|
+
const targetPos = this.pendingScrollPosition;
|
|
8242
|
+
this.pendingScrollPosition = null;
|
|
8243
|
+
this.restoreScrollWithRetries(targetPos);
|
|
8244
|
+
this.isRestoringState = false;
|
|
8245
|
+
}
|
|
8246
|
+
}, 2000);
|
|
8247
|
+
}
|
|
7847
8248
|
};
|
|
8249
|
+
// Propiedades para scroll y cache
|
|
8250
|
+
CollectionEcComponent.stateCache = new Map();
|
|
8251
|
+
CollectionEcComponent.maxCacheSize = 10;
|
|
7848
8252
|
CollectionEcComponent.ctorParameters = () => [
|
|
7849
8253
|
{ type: ProductsService },
|
|
7850
8254
|
{ type: ParametersService },
|
|
@@ -7854,7 +8258,9 @@ CollectionEcComponent.ctorParameters = () => [
|
|
|
7854
8258
|
{ type: AnalyticsService },
|
|
7855
8259
|
{ type: CartService },
|
|
7856
8260
|
{ type: Constants },
|
|
7857
|
-
{ type: FiltersService }
|
|
8261
|
+
{ type: FiltersService },
|
|
8262
|
+
{ type: Router },
|
|
8263
|
+
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
|
|
7858
8264
|
];
|
|
7859
8265
|
__decorate$V([
|
|
7860
8266
|
Input()
|
|
@@ -7868,12 +8274,13 @@ __decorate$V([
|
|
|
7868
8274
|
__decorate$V([
|
|
7869
8275
|
Input()
|
|
7870
8276
|
], CollectionEcComponent.prototype, "optionsFilters", void 0);
|
|
7871
|
-
CollectionEcComponent = __decorate$V([
|
|
8277
|
+
CollectionEcComponent = CollectionEcComponent_1 = __decorate$V([
|
|
7872
8278
|
Component({
|
|
7873
8279
|
selector: 'app-collection-ec',
|
|
7874
8280
|
template: "\r\n<div>\r\n <div class=\"collection\">\r\n <ng-content select=\"[collection]\"> </ng-content>\r\n </div>\r\n\r\n <div class=\"all\">\r\n <ng-content select=\"[all]\"> </ng-content>\r\n </div>\r\n</div>\r\n\r\n<app-blocks-ec [section]=\"'collection'\"></app-blocks-ec>",
|
|
7875
8281
|
styles: [".h1-custom{color:#00f}"]
|
|
7876
|
-
})
|
|
8282
|
+
}),
|
|
8283
|
+
__param$7(10, Inject(PLATFORM_ID))
|
|
7877
8284
|
], CollectionEcComponent);
|
|
7878
8285
|
|
|
7879
8286
|
var __decorate$W = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -7974,7 +8381,7 @@ var __decorate$Y = (this && this.__decorate) || function (decorators, target, ke
|
|
|
7974
8381
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
7975
8382
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7976
8383
|
};
|
|
7977
|
-
var __param$
|
|
8384
|
+
var __param$8 = (this && this.__param) || function (paramIndex, decorator) {
|
|
7978
8385
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
7979
8386
|
};
|
|
7980
8387
|
/** @dynamic */
|
|
@@ -8174,7 +8581,7 @@ FiltersEcComponent = __decorate$Y([
|
|
|
8174
8581
|
template: "",
|
|
8175
8582
|
styles: [""]
|
|
8176
8583
|
}),
|
|
8177
|
-
__param$
|
|
8584
|
+
__param$8(1, Inject(DOCUMENT))
|
|
8178
8585
|
], FiltersEcComponent);
|
|
8179
8586
|
|
|
8180
8587
|
var __decorate$Z = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -8183,7 +8590,7 @@ var __decorate$Z = (this && this.__decorate) || function (decorators, target, ke
|
|
|
8183
8590
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
8184
8591
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
8185
8592
|
};
|
|
8186
|
-
var __param$
|
|
8593
|
+
var __param$9 = (this && this.__param) || function (paramIndex, decorator) {
|
|
8187
8594
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
8188
8595
|
};
|
|
8189
8596
|
/** @dynamic */
|
|
@@ -8271,7 +8678,7 @@ FiltersTopEcComponent = __decorate$Z([
|
|
|
8271
8678
|
template: "",
|
|
8272
8679
|
styles: [".min-width-large{min-width:150px}"]
|
|
8273
8680
|
}),
|
|
8274
|
-
__param$
|
|
8681
|
+
__param$9(1, Inject(DOCUMENT))
|
|
8275
8682
|
], FiltersTopEcComponent);
|
|
8276
8683
|
|
|
8277
8684
|
var __decorate$_ = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -8694,28 +9101,11 @@ let CurrencyService = class CurrencyService {
|
|
|
8694
9101
|
this.getCurrencyListApi = () => 'shop-api/currencies';
|
|
8695
9102
|
this.getConvertibilityApi = (baseCurrency, targetCurrency) => 'shop-api/currencies?baseCurrency=' + baseCurrency + '&targetCurrency=' + targetCurrency;
|
|
8696
9103
|
/**
|
|
8697
|
-
* @description Se carga la moneda por defecto
|
|
9104
|
+
* @description Se carga la moneda por defecto.
|
|
8698
9105
|
*/
|
|
8699
|
-
this.loadDefaultCurrency = (
|
|
8700
|
-
|
|
8701
|
-
this.
|
|
8702
|
-
var _a;
|
|
8703
|
-
this.currencyListSubject.next(list);
|
|
8704
|
-
this.consts.setCurrencyTypeConfig(list);
|
|
8705
|
-
const cfg = (_a = list) === null || _a === void 0 ? void 0 : _a.find(c => c.code === currencyCode);
|
|
8706
|
-
if (cfg) {
|
|
8707
|
-
// Setea moneda activa con su configuración completa
|
|
8708
|
-
this.consts.setCurrency(cfg.code, cfg);
|
|
8709
|
-
}
|
|
8710
|
-
else {
|
|
8711
|
-
this.consts.setCurrency(currencyCode);
|
|
8712
|
-
}
|
|
8713
|
-
this.load();
|
|
8714
|
-
}).catch(() => {
|
|
8715
|
-
// En caso de error, al menos fijá el código para no romper el flujo
|
|
8716
|
-
this.consts.setCurrency(currencyCode);
|
|
8717
|
-
this.load();
|
|
8718
|
-
});
|
|
9106
|
+
this.loadDefaultCurrency = (currency) => {
|
|
9107
|
+
this.consts.setCurrency(currency);
|
|
9108
|
+
this.load();
|
|
8719
9109
|
};
|
|
8720
9110
|
/**
|
|
8721
9111
|
* @description calcula la convetibilidad del precio pasado por paramentro segun esta formula:
|
|
@@ -8734,32 +9124,12 @@ let CurrencyService = class CurrencyService {
|
|
|
8734
9124
|
this.getConvertibility(this.consts.currency.code, code);
|
|
8735
9125
|
});
|
|
8736
9126
|
/**
|
|
8737
|
-
* Carga la lista de monedas
|
|
8738
|
-
*
|
|
8739
|
-
* Si no existe una moneda activa guardada en `localStorage`, inicializa la moneda activa
|
|
8740
|
-
* tomando la moneda base del canal (`ChannelConfigService.baseCurrency`) y sus metadatos
|
|
8741
|
-
* obtenidos de la lista (símbolo, posición, decimales). Si no se encuentra la base en la
|
|
8742
|
-
* lista, usa la primera disponible.
|
|
8743
|
-
*
|
|
8744
|
-
* Finalmente, llama a `load()` para propagar la configuración a los observables y (si aplica)
|
|
8745
|
-
* actualizar `localStorage`.
|
|
8746
|
-
*
|
|
8747
|
-
* @sideEffect Actualiza `currencyList$`, `Constants.setCurrencyTypeConfig` y potencialmente
|
|
8748
|
-
* `Constants.setCurrency`.
|
|
8749
|
-
* @returns void
|
|
9127
|
+
* @description Carga la lista de monedas/currencies.
|
|
8750
9128
|
*/
|
|
8751
9129
|
this.loadCurrencyList = () => {
|
|
8752
9130
|
this.connection.get(this.getCurrencyListApi()).toPromise().then(res => {
|
|
8753
|
-
var _a, _b, _c, _d;
|
|
8754
9131
|
this.currencyListSubject.next(res);
|
|
8755
9132
|
this.consts.setCurrencyTypeConfig(res);
|
|
8756
|
-
const stored = localStorage.getItem('currency');
|
|
8757
|
-
if (!stored) {
|
|
8758
|
-
const base = (_a = this.injector.get(ChannelConfigService).getActiveChannel()) === null || _a === void 0 ? void 0 : _a.baseCurrency;
|
|
8759
|
-
const cfg = (_c = (_b = res) === null || _b === void 0 ? void 0 : _b.find(c => c.code === base), (_c !== null && _c !== void 0 ? _c : (_d = res) === null || _d === void 0 ? void 0 : _d[0]));
|
|
8760
|
-
if (cfg)
|
|
8761
|
-
this.consts.setCurrency(cfg.code, cfg);
|
|
8762
|
-
}
|
|
8763
9133
|
this.load();
|
|
8764
9134
|
});
|
|
8765
9135
|
};
|
|
@@ -8833,6 +9203,7 @@ let CurrencyService = class CurrencyService {
|
|
|
8833
9203
|
}
|
|
8834
9204
|
};
|
|
8835
9205
|
this.injector.get(ChannelConfigService).channelConfig$.subscribe(channel => {
|
|
9206
|
+
console.log(channel);
|
|
8836
9207
|
channel.applyCurrencyExchange ? this.loadCurrencyList() : this.loadDefaultCurrency(channel.baseCurrency);
|
|
8837
9208
|
console.log(this.enableApplyCurrencyExchange);
|
|
8838
9209
|
});
|
|
@@ -9334,11 +9705,9 @@ let ProductDetailEcComponent = class ProductDetailEcComponent extends ComponentH
|
|
|
9334
9705
|
this.showReviews = false;
|
|
9335
9706
|
this.hidePrices = false;
|
|
9336
9707
|
this.creditAccountShowPrices = null;
|
|
9337
|
-
this.enableFieldNotesInArticleFile = false;
|
|
9338
9708
|
this.addToCart = () => {
|
|
9339
9709
|
var _a;
|
|
9340
|
-
|
|
9341
|
-
this.quantity > 0 && this.productService.addToCart(this.quantity, undefined, note);
|
|
9710
|
+
this.quantity > 0 && this.productService.addToCart(this.quantity, undefined, ((_a = this.comments) === null || _a === void 0 ? void 0 : _a.trim()) || null);
|
|
9342
9711
|
};
|
|
9343
9712
|
this.addAllProductosToCart = () => {
|
|
9344
9713
|
var _a, _b;
|
|
@@ -9439,10 +9808,9 @@ let ProductDetailEcComponent = class ProductDetailEcComponent extends ComponentH
|
|
|
9439
9808
|
this.changeImgFocus(productParam.picturesdefault[0]);
|
|
9440
9809
|
});
|
|
9441
9810
|
this.injector.get(ChannelConfigService).channelConfig$.subscribe(channel => {
|
|
9442
|
-
var _a, _b
|
|
9811
|
+
var _a, _b;
|
|
9443
9812
|
this.showReviews = channel.showReviews;
|
|
9444
9813
|
this.hidePrices = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
9445
|
-
this.enableFieldNotesInArticleFile = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.enableFieldNotesInArticleFile, (_d !== null && _d !== void 0 ? _d : false));
|
|
9446
9814
|
});
|
|
9447
9815
|
this.cartService.showPrice$.subscribe((showPrice) => {
|
|
9448
9816
|
this.creditAccountShowPrices = showPrice;
|
|
@@ -9457,28 +9825,6 @@ let ProductDetailEcComponent = class ProductDetailEcComponent extends ComponentH
|
|
|
9457
9825
|
}
|
|
9458
9826
|
ngOnInit() {
|
|
9459
9827
|
this.ecOnInit();
|
|
9460
|
-
// Prellenar comentarios cuando:
|
|
9461
|
-
// - cargue el producto
|
|
9462
|
-
// - cambie la variante seleccionada (asociatedData$)
|
|
9463
|
-
// - cambien los ítems del carrito
|
|
9464
|
-
this.prefillSub = combineLatest([
|
|
9465
|
-
this.productService.product$.pipe(filter((p) => !!p && !!p.id)),
|
|
9466
|
-
this.productService.asociatedData$.pipe(startWith(null)),
|
|
9467
|
-
this.cartService.cartItems.pipe(startWith([])),
|
|
9468
|
-
]).subscribe(([product, data, items]) => {
|
|
9469
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
9470
|
-
const variantId = (_h = (_d = (_b = (_a = data) === null || _a === void 0 ? void 0 : _a.variantCode, (_b !== null && _b !== void 0 ? _b : (_c = data) === null || _c === void 0 ? void 0 : _c.variant_id)), (_d !== null && _d !== void 0 ? _d : (_g = (_f = (_e = product) === null || _e === void 0 ? void 0 : _e.variants) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.code)), (_h !== null && _h !== void 0 ? _h : null));
|
|
9471
|
-
const match = (_j = items) === null || _j === void 0 ? void 0 : _j.find(it => {
|
|
9472
|
-
var _a, _b, _c, _d;
|
|
9473
|
-
return ((_b = (_a = it) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.id) === ((_c = product) === null || _c === void 0 ? void 0 : _c.id) &&
|
|
9474
|
-
(variantId ? ((_d = it) === null || _d === void 0 ? void 0 : _d.variant_id) === variantId : true);
|
|
9475
|
-
});
|
|
9476
|
-
this.comments = (_l = (_k = match) === null || _k === void 0 ? void 0 : _k.comments, (_l !== null && _l !== void 0 ? _l : ''));
|
|
9477
|
-
});
|
|
9478
|
-
}
|
|
9479
|
-
ngOnDestroy() {
|
|
9480
|
-
var _a;
|
|
9481
|
-
(_a = this.prefillSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
9482
9828
|
}
|
|
9483
9829
|
scroll() {
|
|
9484
9830
|
let el = this.contact.nativeElement;
|
|
@@ -9609,6 +9955,7 @@ let ProductEcComponent = class ProductEcComponent extends ComponentHelper {
|
|
|
9609
9955
|
ngOnChanges() {
|
|
9610
9956
|
}
|
|
9611
9957
|
selectItem(product) {
|
|
9958
|
+
console.log('entro');
|
|
9612
9959
|
this.analyticsService.callEvent('select_item', product);
|
|
9613
9960
|
}
|
|
9614
9961
|
};
|
|
@@ -10043,7 +10390,7 @@ var __decorate$1a = (this && this.__decorate) || function (decorators, target, k
|
|
|
10043
10390
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10044
10391
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10045
10392
|
};
|
|
10046
|
-
var __param$
|
|
10393
|
+
var __param$a = (this && this.__param) || function (paramIndex, decorator) {
|
|
10047
10394
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10048
10395
|
};
|
|
10049
10396
|
let SellerDashboardContainerEcComponent = class SellerDashboardContainerEcComponent extends ComponentHelper {
|
|
@@ -10156,7 +10503,7 @@ SellerDashboardContainerEcComponent = __decorate$1a([
|
|
|
10156
10503
|
template: "<section *ngIf=\"user\" id=\"seller-dashboard\">\r\n <div class=\"section-content mt-5 mb-2 tablaVendedores\">\r\n <div class=\"container-xl\">\r\n <div class=\"row\">\r\n <main class=\"col-md-12\">\r\n\r\n <ul *ngIf=\"hasHeader()\" class=\"nav nav-tabs\">\r\n <li class=\"nav-item col-12 col-lg-2\">\r\n <a *ngIf=\"hasUIComponent('HEADER_TAB')\" class=\"nav-link active cursor-pointer px-4\"\r\n aria-current=\"page\">\r\n {{ 'my-clients' | translate }}\r\n </a>\r\n </li>\r\n <li class=\"ms-auto row\">\r\n <div\r\n class=\"d-flex justify-content-end justify-content-lg-end justify-content-xl-end col-12 col-md-12 col-lg-auto\">\r\n <ng-container *ngIf=\"hasUIComponent('GENERATE_BUDGET_BTN') \">\r\n <a *ngIf=\"authService.getCustomer()?.id; else withoutCustomer\"\r\n [routerLink]=\"'/collection'\"\r\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"><i\r\n class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate }}\r\n </a>\r\n <ng-template #withoutCustomer>\r\n <a class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"\r\n (click)=\"toastrService.show('must-select-customer')\">\r\n <i class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate\r\n }}\r\n </a>\r\n </ng-template>\r\n </ng-container>\r\n <a *ngIf=\"hasUIComponent('MANAGE_ORDERS_BTN')\"\r\n (click)=\"navigateExternal(constants.getUrlBase())\"\r\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center me- me-lg-4 mr- mr-lg-4\"><i\r\n class=\"bi bi-archive-fill me-2 mr-2\"></i>{{ 'manage-orders' | translate }}</a>\r\n </div>\r\n <div class=\"d-flex camposVendedores col-12 col-md-12 col-lg-auto justify-content-end\">\r\n <select *ngIf=\"hasUIComponent('SORT_SELECT')\" id=\"customerSort\" name=\"customerSort\"\r\n (change)=\"sortCustomers($event.target.value)\" class=\"mb-1 ordenarVendedores form-select\">\r\n <option selected hidden disabled>{{ 'order-by' | translate }}</option>\r\n <option value='asc_firstName'>{{ 'client' | translate }} (A-Z)</option>\r\n <option value='desc_firstName'>{{ 'client' | translate }} (Z-A)</option>\r\n <option value='asc_id'>Menor a Mayor c\u00F3digo</option>\r\n <option value='desc_id'>Mayor a Menor c\u00F3digo</option>\r\n </select>\r\n <form *ngIf=\"hasUIComponent('SEARCH_FORM')\"\r\n class=\"col-lg-auto mb-lg-0 d-flex ms-3 ml-3 d-flex buscadorVendedores\">\r\n <input type=\"text\" name=\"searchInput\" class=\"form-control\"\r\n placeholder=\"{{ 'search' | translate }}\" [(ngModel)]=\"searchInput\"\r\n (keyup.enter)=\"updateCustomers()\">\r\n <button class=\"btn btn-primary ms-1 ml-1 bg-white border-dark btnSearch\"><i\r\n class=\"bi bi-search text-dark\" (click)=\"updateCustomers()\"></i></button>\r\n </form>\r\n </div>\r\n </li>\r\n </ul>\r\n\r\n <ng-container *ngIf=\"user.customers?.length; else noCustomers\">\r\n\r\n <article class=\"card card-body mb-1 carritoProductoHeader m-0 py-0 mt-4\">\r\n <div class=\"row align-items-center font-bold border-bottom\">\r\n <div class=\"col-3 col-md-2 text-left\">\r\n <small>{{ 'code' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-5 col-md-3 mb-md-0\">\r\n <small>{{ 'client' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\r\n <small>{{ 'user' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-4 col-md-2 text-left\">\r\n <small>{{ 'new-orders' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-2 col-md-2 text-left d-none d-md-block\">\r\n <small></small>\r\n </div>\r\n\r\n </div>\r\n </article>\r\n\r\n <article *ngFor=\"let customer of filteredCustomers\" [class]=\"'card card-body mb-3 cadaVendedor ' + (isActive(customer) ? 'activo':'')\">\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-3 col-md-2 text-left ps-2 pl-2\">\r\n <div class=\"price h6 pb-0 mb-0 ps-3 pl-1\">\r\n {{ customer.managementSystemInternalCode || 'n/a' }}\r\n </div>\r\n </div>\r\n <div class=\"col-5 col-md-3 text-left\">\r\n <div class=\"price h6 fw-normal ps-2 pl-2 pb-0 mb-0\">\r\n {{ customer.firstName }} {{ customer.lastName }}\r\n <p class=\"d-block d-md-none fs-6 mt-1 mb-0 p-0 userMobile\">\r\n {{ customer.email }}\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\r\n <div class=\"price h6 fw-normal pb-0 mb-0 ps-2 pl-2\">\r\n {{ customer.email }}\r\n </div>\r\n </div>\r\n <div class=\"col-4 col-md-2 text-left ps-2 pl-2\">\r\n <div *ngIf=\"true\" class=\"contNumero\">\r\n {{ customer.ordersNotApproved }}\r\n </div>\r\n </div>\r\n <div class=\"col-12 col-md-2 btnIngresar\">\r\n\r\n <ng-container\r\n *ngIf=\"authService.getCustomer()?.id == customer.id; else noActiveCustomer\">\r\n <a (click)=\"changeCustomer(null)\"\r\n class=\"btn btn-seller-primary justify-content-center\">\r\n <i class=\"bi bi-box-arrow-left me-2 mr-2\"></i>\r\n <small class=\"me-2 mr-2 d-none d-md-block\">\r\n {{ 'exit' | translate | uppercase }}\r\n </small>\r\n </a>\r\n </ng-container>\r\n <ng-template #noActiveCustomer>\r\n <a (click)=\"changeCustomer(customer)\"\r\n class=\"btn btn-seller-primary justify-content-center\">\r\n <i class=\"bi bi-box-arrow-in-right me-2 mr-2\"></i>\r\n <small class=\"me-2 mr-2 d-none d-md-block\">\r\n {{ 'operate-as' | translate | uppercase }}\r\n </small>\r\n </a>\r\n </ng-template>\r\n\r\n </div>\r\n </div>\r\n </article>\r\n\r\n </ng-container>\r\n\r\n </main>\r\n </div>\r\n </div>\r\n </div>\r\n</section>\r\n\r\n<ng-template #noCustomers>\r\n <h4 class=\"text-center p-5\">{{ 'no-customers' | translate }}</h4>\r\n</ng-template>",
|
|
10157
10504
|
styles: ["#seller-dashboard{--seller-dashboard-primary-color:0,0,0}.btn-seller-primary{color:#fff!important;background-color:rgba(var(--seller-dashboard-primary-color),1)!important;border-color:rgba(var(--seller-dashboard-primary-color),1)!important}.btn-seller-primary:hover{background-color:rgba(var(--seller-dashboard-primary-color),.9)!important}.btn-seller-primary:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)!important}.btnGestionar{padding:6px 12px!important;height:36px;display:flex;align-items:center;justify-content:center;margin-left:10px}.ordenarVendedores{width:150px!important;color:#8b8b8b!important;background-color:#fff;border:1px solid #b6b6b6!important;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px}.buscadorVendedores{margin-bottom:4px!important}.buscadorVendedores input{border:1px solid #b6b6b6!important;width:200px}.buscadorVendedores .btnSearch{border:1px solid #b6b6b6!important;padding:.375rem .75rem;font-size:1rem}.buscadorVendedores .btnSearch:focus{background-color:#fff!important}.carritoProductoHeader{border:none!important}.carritoProductoHeader small{font-size:13px}.cadaVendedor{padding:5px 0;margin-bottom:0!important;border:none!important;border-bottom:1px solid #ccc!important;border-radius:0!important;-webkit-border-radius:0}.cadaVendedor .btnIngresar a{padding:10px!important;border-width:1px!important;border-style:solid!important;display:flex;align-items:center;width:100%!important;margin-left:auto;color:#fff}.cadaVendedor .btnIngresar .contNumero{background-color:#eee;width:20px;height:20px;color:#000;font-size:13px;display:flex;align-items:center;justify-content:center;font-weight:600;border-radius:20px;-webkit-border-radius:20px;-moz-border-radius:20px;-ms-border-radius:20px;-o-border-radius:20px}.userMobile{font-size:14px!important;font-style:italic!important}.cadaVendedor .btnIngresar a:hover{background-color:rgba(var(--seller-dashboard-primary-color),.85)}.cadaVendedor .btnIngresar a:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)}.cursor-pointer{cursor:pointer}.font-bold{font-weight:700}.border-bottom{border-bottom:1px solid #000!important}@media screen and (max-width:1200px){.btnGestionar{font-size:12px}}@media screen and (max-width:992px){.camposVendedores{justify-content:flex-end;margin-top:8px;margin-bottom:4px}}@media all and (max-width:768px){.ordenarVendedores{width:140px!important}.buscadorVendedores input{width:140px}.cadaVendedor .btnIngresar a{width:70px!important}}@media all and (max-width:576px){.tablaVendedores .nav-tabs .nav-link{font-size:13px;padding:6px!important}.btnGestionar{padding:6px 8px!important;font-size:13px;height:36px;display:flex;align-items:center;justify-content:center;margin-top:3px;margin-left:10px}.buscadorVendedores input,.ordenarVendedores{font-size:13px}}.fs-6{font-size:1rem!important}.cadaVendedor.activo{background-color:#eee}"]
|
|
10158
10505
|
}),
|
|
10159
|
-
__param$
|
|
10506
|
+
__param$a(3, Inject('env'))
|
|
10160
10507
|
], SellerDashboardContainerEcComponent);
|
|
10161
10508
|
|
|
10162
10509
|
var __decorate$1b = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -10680,8 +11027,8 @@ __decorate$1f([
|
|
|
10680
11027
|
PriceEcComponent = __decorate$1f([
|
|
10681
11028
|
Component({
|
|
10682
11029
|
selector: 'app-price-ec',
|
|
10683
|
-
template: "<!-- Si hay templates personalizados, se proyectan -->\r\n<ng-container *ngIf=\"customSalePriceTemplate || customPriceTemplate; else defaultPriceBlock\">\r\n <ng-container *ngTemplateOutlet=\"customPriceTemplate || defaultPriceBlock\"></ng-container>\r\n</ng-container>\r\n\r\n<ng-template #defaultPriceBlock>\r\n <div *ngIf=\"saleprice; else onlyprice\" class=\"line-height-custom\">\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePriceDel\">\r\n <del class=\"tachado\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </del>\r\n </div>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"saleprice && saleprice.split(' - ').length > 1; else simpleSalePrice\">\r\n {{ saleprice.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ saleprice.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </div>\r\n\r\n <ng-template #onlyprice>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePrice\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }} -\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePrice>\r\n <ng-container *ngIf=\"customSimplePriceTemplate; else fallbackSimplePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimplePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimplePrice>\r\n <div [class]=\"'uno line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ price | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePriceDel>\r\n <div [class]=\"'dos line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n <span class=\"lnth\">{{ price | ecCurrencySymbol }}</span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simpleSalePrice>\r\n <ng-container *ngIf=\"customSimpleSalePriceTemplate; else fallbackSimpleSalePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimpleSalePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimpleSalePrice>\r\n <div [class]=\"'tres line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ saleprice | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<!-- Secci\u00F3n de impuestos -->\r\n<ng-container *ngIf=\"shouldShowTaxes\">\r\n <ng-container *ngIf=\"showTaxLegendOnly; else detailedTaxBlock\">\r\n <ng-container *ngIf=\"customOnlyTaxLabelTemplate; else defaultOnlyTaxLabelBlock\">\r\n <ng-container *ngTemplateOutlet=\"customOnlyTaxLabelTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultOnlyTaxLabelBlock>\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}:
|
|
10684
|
-
styles: [".price-sm{font-size:13px}.price{font-size:18px}.lnth{text-decoration:line-through;color:gray}.taxes-section{margin-top:.5rem;border-radius:.5rem;font-size:.95rem;color:#333;line-height:1.4;max-width:400px}.taxes-title{font-weight:500;margin-bottom:.2rem;font-size:.7rem;color:#222}.taxes-list{list-style-type:none;padding-left:0;margin:0}.taxes-list li{margin-bottom:.05rem;font-size:.65rem;display:flex;justify-content:space-between}
|
|
11030
|
+
template: "<!-- Si hay templates personalizados, se proyectan -->\r\n<ng-container *ngIf=\"customSalePriceTemplate || customPriceTemplate; else defaultPriceBlock\">\r\n <ng-container *ngTemplateOutlet=\"customPriceTemplate || defaultPriceBlock\"></ng-container>\r\n</ng-container>\r\n\r\n<ng-template #defaultPriceBlock>\r\n <div *ngIf=\"saleprice; else onlyprice\" class=\"line-height-custom\">\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePriceDel\">\r\n <del class=\"tachado\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </del>\r\n </div>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"saleprice && saleprice.split(' - ').length > 1; else simpleSalePrice\">\r\n {{ saleprice.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ saleprice.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </div>\r\n\r\n <ng-template #onlyprice>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePrice\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }} -\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePrice>\r\n <ng-container *ngIf=\"customSimplePriceTemplate; else fallbackSimplePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimplePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimplePrice>\r\n <div [class]=\"'uno line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ price | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePriceDel>\r\n <div [class]=\"'dos line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n <span class=\"lnth\">{{ price | ecCurrencySymbol }}</span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simpleSalePrice>\r\n <ng-container *ngIf=\"customSimpleSalePriceTemplate; else fallbackSimpleSalePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimpleSalePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimpleSalePrice>\r\n <div [class]=\"'tres line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ saleprice | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<!-- Secci\u00F3n de impuestos -->\r\n<ng-container *ngIf=\"shouldShowTaxes\">\r\n <ng-container *ngIf=\"showTaxLegendOnly; else detailedTaxBlock\">\r\n <ng-container *ngIf=\"customOnlyTaxLabelTemplate; else defaultOnlyTaxLabelBlock\">\r\n <ng-container *ngTemplateOutlet=\"customOnlyTaxLabelTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultOnlyTaxLabelBlock>\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}: {{ basePrice | ecCurrencySymbol }}\r\n </p>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <ng-template #detailedTaxBlock>\r\n <ng-container *ngIf=\"customTaxTemplate; else defaultTaxBlock\">\r\n <ng-container *ngTemplateOutlet=\"customTaxTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<ng-template #defaultTaxBlock>\r\n <div class=\"taxes-section\">\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}: {{ basePrice | ecCurrencySymbol }}</p>\r\n <ul class=\"taxes-list\">\r\n <li>\r\n {{ taxes.Name }}: {{ taxeAmount | ecCurrencySymbol }}\r\n </li>\r\n </ul>\r\n </div>\r\n</ng-template>",
|
|
11031
|
+
styles: [".price-sm{font-size:13px}.price{font-size:18px}.lnth{text-decoration:line-through;color:gray}.taxes-section{margin-top:.5rem;border-radius:.5rem;font-size:.95rem;color:#333;line-height:1.4;max-width:400px}.taxes-title{font-weight:500;margin-bottom:.2rem;font-size:.7rem;color:#222}.taxes-list{list-style-type:none;padding-left:0;margin:0}.taxes-list li{margin-bottom:.05rem;font-size:.65rem;display:flex;justify-content:space-between}"]
|
|
10685
11032
|
})
|
|
10686
11033
|
], PriceEcComponent);
|
|
10687
11034
|
|
|
@@ -10784,7 +11131,7 @@ var __decorate$1h = (this && this.__decorate) || function (decorators, target, k
|
|
|
10784
11131
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10785
11132
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10786
11133
|
};
|
|
10787
|
-
var __param$
|
|
11134
|
+
var __param$b = (this && this.__param) || function (paramIndex, decorator) {
|
|
10788
11135
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10789
11136
|
};
|
|
10790
11137
|
/** @dynamic */
|
|
@@ -10908,7 +11255,7 @@ RedSysProEcComponent = __decorate$1h([
|
|
|
10908
11255
|
providers: [BsModalService],
|
|
10909
11256
|
styles: [".half-width{width:49%!important}.ml-1{margin-left:1%}#card-form{height:450px}.iframeStyle{height:800px;width:100%;max-height:800px}"]
|
|
10910
11257
|
}),
|
|
10911
|
-
__param$
|
|
11258
|
+
__param$b(6, Inject(DOCUMENT))
|
|
10912
11259
|
], RedSysProEcComponent);
|
|
10913
11260
|
|
|
10914
11261
|
var __decorate$1i = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -11369,7 +11716,6 @@ let OrderEcComponent = class OrderEcComponent extends ComponentHelper {
|
|
|
11369
11716
|
this.hidePrices = false;
|
|
11370
11717
|
this.hideDiscounts = false;
|
|
11371
11718
|
this.hideTaxes = false;
|
|
11372
|
-
this.enableFieldNotesInArticleFile = false;
|
|
11373
11719
|
this.toDate = (date, format) => moment(date).format(!format && 'DD/MM/YYYY, h:mm:ss a' || format);
|
|
11374
11720
|
this.callError = () => {
|
|
11375
11721
|
this.error = '?';
|
|
@@ -11400,7 +11746,7 @@ let OrderEcComponent = class OrderEcComponent extends ComponentHelper {
|
|
|
11400
11746
|
this.callError();
|
|
11401
11747
|
};
|
|
11402
11748
|
this.channelConfigService.channelConfig$.subscribe((config) => {
|
|
11403
|
-
var _a, _b, _c, _d, _e, _f
|
|
11749
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11404
11750
|
if (config && config.allowRepeatOrders !== undefined) {
|
|
11405
11751
|
this.allowRepeatOrders = config.allowRepeatOrders;
|
|
11406
11752
|
}
|
|
@@ -11410,7 +11756,6 @@ let OrderEcComponent = class OrderEcComponent extends ComponentHelper {
|
|
|
11410
11756
|
this.hidePrices = (_b = (_a = config) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
11411
11757
|
this.hideDiscounts = (_d = (_c = config) === null || _c === void 0 ? void 0 : _c.hideDiscounts, (_d !== null && _d !== void 0 ? _d : false));
|
|
11412
11758
|
this.hideTaxes = (_f = (_e = config) === null || _e === void 0 ? void 0 : _e.hideTaxes, (_f !== null && _f !== void 0 ? _f : false));
|
|
11413
|
-
this.enableFieldNotesInArticleFile = (_h = (_g = config) === null || _g === void 0 ? void 0 : _g.enableFieldNotesInArticleFile, (_h !== null && _h !== void 0 ? _h : false));
|
|
11414
11759
|
});
|
|
11415
11760
|
this.cartService.showPrice$.subscribe((showPrice) => {
|
|
11416
11761
|
this.creditAccountShowPrices = showPrice;
|
|
@@ -11437,7 +11782,7 @@ __decorate$1l([
|
|
|
11437
11782
|
OrderEcComponent = __decorate$1l([
|
|
11438
11783
|
Component({
|
|
11439
11784
|
selector: 'app-order-ec',
|
|
11440
|
-
template: "<main class=\"py-5\" id=\"orderEcComponent\">\r\n <div class=\"container\">\r\n <div class=\"wrap\" *ngIf=\"!loading; else loadingView\">\r\n <div *ngIf=\"order; else noOrder\">\r\n\r\n <div class=\"row justify-content-between \">\r\n <div class=\"col-sm-auto col-12 font-brandon\">\r\n <h4 class=\"tit1 fw-bold\">{{ ('order' | translate) + ': ' + order.number }}</h4>\r\n </div>\r\n <ng-container *ngIf=\"order?.invoice\">\r\n <div class=\"col-sm col-12 font-brandon\" *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <a target=\"_blank\" [href]=\"consts.getUrlBase().slice(0, -1) + order.invoice\"\r\n class=\"btn btn-link btn-invoice\">\r\n <i class=\"fas fa-file-download me-1\"></i>\r\n {{ 'download' | translate }} {{ 'invoices' | translate | titlecase }}\r\n </a>\r\n </div>\r\n </ng-container>\r\n <a (click)=\"volver()\" class=\"col-auto text-end\">\r\n <button class=\"btn btvolver bg-gray text-white\">{{ 'back-to-orders' | translate }}</button>\r\n </a>\r\n </div>\r\n\r\n <section id=\"orders\">\r\n <div class=\"row pt-2\">\r\n <div class=\"col-md-2 col-12\">\r\n <p class=\"st\">{{ 'payment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'payment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0]?.method?.name | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].method.name }}\r\n </p>\r\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\r\n <a *ngIf=\"order.tracking\" [href]=\"order.tracking\"\r\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver\r\n seguimiento</a>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'date' | translate }}:</p>\r\n <p class=\"\">\r\n {{ toDate(order.checkoutCompletedAt, 'DD/MM/YYYY') | translate }}<br>\r\n {{ toDate(order.checkoutCompletedAt, 'h:mm:ss a') | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"st\">{{ 'total' | translate }}:</p>\r\n <h5 class=\"fw-bold\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n\r\n </h5>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <div class=\"text-end mt-3\" *ngIf=\"!hidePrices && allowRepeatOrders\">\r\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder()\">\r\n {{ 'repeat-order' | translate }}\r\n </button>\r\n </div>\r\n\r\n <div class=\"container py-3 border-top border-bottom\">\r\n <div *ngIf=\"order.items.length; else noProducts\" class=\"row\">\r\n <div class=\"col-2 font-sm font-brandon d-none d-md-block\">\r\n {{ 'product' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-4 font-sm font-brandon d-none d-md-block\">\r\n {{ 'description' | translate | uppercase }}\r\n </div>\r\n <div id=\"colLots\" *ngIf=\"ordersService.channelConfig.applyOrderLot\"\r\n class=\"col-1 font-sm font-brandon d-none d-md-block\">\r\n <!-- {{ 'description' | translate | uppercase }} -->\r\n {{ 'lots' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'unit-price' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-1 text-center font-sm font-brandon d-none d-md-block\">\r\n {{ 'quantity' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'total' | translate | uppercase }}\r\n </div>\r\n </div>\r\n <ng-container *ngFor=\"let item of order.items; let i = index\">\r\n <div class=\"row cart-items\">\r\n <div class=\"col-5 col-md-2 py-2\">\r\n <ng-container *ngIf=\"item.product.variants[0]?.images?.length ; else defaultpicture\">\r\n <img class=\"smc maxwidth img-fluid rounded-custom \"\r\n [src]=\"consts.mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\r\n </ng-container>\r\n <ng-template #defaultpicture>\r\n <img *ngIf=\"item.product.picturesdefault\"\r\n class=\"smc maxwidth img-fluid rounded-custom\"\r\n [src]=\"consts.mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\r\n </ng-template>\r\n </div> \r\n <div\r\n class=\"col-md-4 col-7 d-flex flex-column justify-content-center\">\r\n <p class=\"font-brandon d-flex w-100 mb-0\">\r\n {{ item.product.name }} (Cod:{{ item.product.variants[0].code }})\r\n </p>\r\n <p *ngIf=\"enableFieldNotesInArticleFile && item.comments\" class=\"comment-truncated fst-italic small text-muted mt-1\">\r\n \"{{ item.comments }}\"\r\n </p>\r\n </div>\r\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\"\r\n *ngIf=\"ordersService.channelConfig.applyOrderLot\">\r\n <input type=\"button\" class=\"btn btn-primary btnSeguir m-0 text-center\" type=\"button\"\r\n [attr.data-bs-toggle]=\"'collapse'\" [attr.data-bs-target]=\"'#collapseExample'+i\"\r\n aria-expanded=\"false\" [attr.aria-controls]=\"'collapseExample'+i\"\r\n value=\"{{ 'see' | translate | uppercase }}\">\r\n </div>\r\n <div class=\"container d-md-none\">\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ (item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) |\r\n ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ ((item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) *\r\n item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\">\r\n {{ (item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n </p>\r\n </div>\r\n <div class=\"col-1 d-none d-md-flex align-items-center\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-end w-100 m-0\">\r\n {{ ((item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) * item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"collapse\" [attr.id]=\"'collapseExample'+i\">\r\n <div class=\"card card-body\">\r\n <table class=\"table table-striped\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\">#</th>\r\n <th scope=\"col\">Estado</th>\r\n <th scope=\"col\">Cantidad</th>\r\n <th scope=\"col\">Fecha Solicitada</th>\r\n <th scope=\"col\">Fecha Estimada</th>\r\n <th scope=\"col\">Sede</th>\r\n <th scope=\"col\">Nota</th>\r\n <th scope=\"col\">Total Lote</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let lot of item.orderItemLot\">\r\n <tr>\r\n <th scope=\"row\">{{lot.id}}</th>\r\n <td>{{lot.lot_status}}</td>\r\n <td>{{lot.quantity}}</td>\r\n <td>{{ toDate(lot.date_request, 'DD/MM/YYYY') | translate }}</td>\r\n <td *ngIf=\"lot.date_deliver; else sinFechaEstimada\">{{\r\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\r\n <ng-template #sinFechaEstimada>\r\n <td>Pendiente</td>\r\n </ng-template>\r\n <td>{{lot.shipping_address_name}}</td>\r\n <td>{{lot.notes}}</td>\r\n <td>{{lot.total_lot | ecCurrencySymbol:'alwaysShowDecimals'}}</td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-6\"></div>\r\n <div class=\"col-12 col-md-6\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <div class=\"row py-4\">\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'total-products' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.subtotal) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'shipment' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.shipping || '0') | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n\r\n </div>\r\n\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\r\n translate }}</div>\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\r\n {{ (order.totals.promotion) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0 \"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">\r\n {{ 'taxes' | translate }}</div>\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.taxes) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div class=\"col-6 font-brandon font-md\">{{ 'total' | translate | uppercase }}</div>\r\n <div class=\"col-6 font-brandon font-md text-end\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</main>\r\n\r\n<ng-template #noOrder>\r\n <div class=\"w-100 h-50\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <h5>{{ 'no-orders' | translate }}</h5>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #loadingView>\r\n <div class=\"w-100 h-50 py-5\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
11785
|
+
template: "<main class=\"py-5\" id=\"orderEcComponent\">\r\n <div class=\"container\">\r\n <div class=\"wrap\" *ngIf=\"!loading; else loadingView\">\r\n <div *ngIf=\"order; else noOrder\">\r\n\r\n <div class=\"row justify-content-between \">\r\n <div class=\"col-sm-auto col-12 font-brandon\">\r\n <h4 class=\"tit1 fw-bold\">{{ ('order' | translate) + ': ' + order.number }}</h4>\r\n </div>\r\n <ng-container *ngIf=\"order?.invoice\">\r\n <div class=\"col-sm col-12 font-brandon\">\r\n <a target=\"_blank\" [href]=\"consts.getUrlBase().slice(0, -1) + order.invoice\"\r\n class=\"btn btn-link btn-invoice\">\r\n <i class=\"fas fa-file-download me-1\"></i>\r\n {{ 'download' | translate }} {{ 'invoices' | translate | titlecase }}\r\n </a>\r\n </div>\r\n </ng-container>\r\n <a (click)=\"volver()\" class=\"col-auto text-end\">\r\n <button class=\"btn btvolver bg-gray text-white\">{{ 'back-to-orders' | translate }}</button>\r\n </a>\r\n </div>\r\n\r\n <section id=\"orders\">\r\n <div class=\"row pt-2\">\r\n <div class=\"col-md-2 col-12\">\r\n <p class=\"st\">{{ 'payment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'payment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0]?.method?.name | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].method.name }}\r\n </p>\r\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\r\n <a *ngIf=\"order.tracking\" [href]=\"order.tracking\"\r\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver\r\n seguimiento</a>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'date' | translate }}:</p>\r\n <p class=\"\">\r\n {{ toDate(order.checkoutCompletedAt, 'DD/MM/YYYY') | translate }}<br>\r\n {{ toDate(order.checkoutCompletedAt, 'h:mm:ss a') | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"st\">{{ 'total' | translate }}:</p>\r\n <h5 class=\"fw-bold\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n\r\n </h5>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <div class=\"text-end mt-3\" *ngIf=\"!hidePrices && allowRepeatOrders\">\r\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder()\">\r\n {{ 'repeat-order' | translate }}\r\n </button>\r\n </div>\r\n\r\n <div class=\"container py-3 border-top border-bottom\">\r\n <div *ngIf=\"order.items.length; else noProducts\" class=\"row\">\r\n <div class=\"col-2 font-sm font-brandon d-none d-md-block\">\r\n {{ 'product' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-4 font-sm font-brandon d-none d-md-block\">\r\n {{ 'description' | translate | uppercase }}\r\n </div>\r\n <div id=\"colLots\" *ngIf=\"ordersService.channelConfig.applyOrderLot\"\r\n class=\"col-1 font-sm font-brandon d-none d-md-block\">\r\n <!-- {{ 'description' | translate | uppercase }} -->\r\n {{ 'lots' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'unit-price' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-1 text-center font-sm font-brandon d-none d-md-block\">\r\n {{ 'quantity' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'total' | translate | uppercase }}\r\n </div>\r\n </div>\r\n <ng-container *ngFor=\"let item of order.items; let i = index\">\r\n <div class=\"row cart-items\">\r\n <div class=\"col-5 col-md-2 py-2\">\r\n <ng-container *ngIf=\"item.product.variants[0]?.images?.length ; else defaultpicture\">\r\n <img class=\"smc maxwidth img-fluid rounded-custom \"\r\n [src]=\"consts.mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\r\n </ng-container>\r\n <ng-template #defaultpicture>\r\n <img *ngIf=\"item.product.picturesdefault\"\r\n class=\"smc maxwidth img-fluid rounded-custom\"\r\n [src]=\"consts.mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\r\n </ng-template>\r\n </div> \r\n <div\r\n class=\"col-md-4 col-7 d-flex flex-column justify-content-center\">\r\n <p class=\"font-brandon d-flex w-100 mb-0\">\r\n {{ item.product.name }} (Cod:{{ item.product.variants[0].code }})\r\n </p>\r\n <p *ngIf=\"item.comments\" class=\"comment-truncated fst-italic small text-muted mt-1\">\r\n \"{{ item.comments }}\"\r\n </p>\r\n </div>\r\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\"\r\n *ngIf=\"ordersService.channelConfig.applyOrderLot\">\r\n <input type=\"button\" class=\"btn btn-primary btnSeguir m-0 text-center\" type=\"button\"\r\n [attr.data-bs-toggle]=\"'collapse'\" [attr.data-bs-target]=\"'#collapseExample'+i\"\r\n aria-expanded=\"false\" [attr.aria-controls]=\"'collapseExample'+i\"\r\n value=\"{{ 'see' | translate | uppercase }}\">\r\n </div>\r\n <div class=\"container d-md-none\">\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ (item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) |\r\n ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ ((item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) *\r\n item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\">\r\n {{ (item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n </p>\r\n </div>\r\n <div class=\"col-1 d-none d-md-flex align-items-center\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-end w-100 m-0\">\r\n {{ ((item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) * item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"collapse\" [attr.id]=\"'collapseExample'+i\">\r\n <div class=\"card card-body\">\r\n <table class=\"table table-striped\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\">#</th>\r\n <th scope=\"col\">Estado</th>\r\n <th scope=\"col\">Cantidad</th>\r\n <th scope=\"col\">Fecha Solicitada</th>\r\n <th scope=\"col\">Fecha Estimada</th>\r\n <th scope=\"col\">Sede</th>\r\n <th scope=\"col\">Nota</th>\r\n <th scope=\"col\">Total Lote</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let lot of item.orderItemLot\">\r\n <tr>\r\n <th scope=\"row\">{{lot.id}}</th>\r\n <td>{{lot.lot_status}}</td>\r\n <td>{{lot.quantity}}</td>\r\n <td>{{ toDate(lot.date_request, 'DD/MM/YYYY') | translate }}</td>\r\n <td *ngIf=\"lot.date_deliver; else sinFechaEstimada\">{{\r\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\r\n <ng-template #sinFechaEstimada>\r\n <td>Pendiente</td>\r\n </ng-template>\r\n <td>{{lot.shipping_address_name}}</td>\r\n <td>{{lot.notes}}</td>\r\n <td>{{lot.total_lot | ecCurrencySymbol:'alwaysShowDecimals'}}</td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-6\"></div>\r\n <div class=\"col-12 col-md-6\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <div class=\"row py-4\">\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'total-products' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.subtotal) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'shipment' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.shipping || '0') | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n\r\n </div>\r\n\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\r\n translate }}</div>\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\r\n {{ (order.totals.promotion) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0 \"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">\r\n {{ 'taxes' | translate }}</div>\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.taxes) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div class=\"col-6 font-brandon font-md\">{{ 'total' | translate | uppercase }}</div>\r\n <div class=\"col-6 font-brandon font-md text-end\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</main>\r\n\r\n<ng-template #noOrder>\r\n <div class=\"w-100 h-50\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <h5>{{ 'no-orders' | translate }}</h5>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #loadingView>\r\n <div class=\"w-100 h-50 py-5\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
11441
11786
|
styles: [".maxwidth{max-width:100px}.comment-truncated{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;white-space:normal;max-height:3em}"]
|
|
11442
11787
|
})
|
|
11443
11788
|
], OrderEcComponent);
|
|
@@ -12940,10 +13285,12 @@ let PaypalExpressEcComponent = class PaypalExpressEcComponent extends ComponentH
|
|
|
12940
13285
|
this.loading = false;
|
|
12941
13286
|
}
|
|
12942
13287
|
else {
|
|
13288
|
+
/* console.log('Entro al else'); */
|
|
12943
13289
|
this.renderPayPal();
|
|
12944
13290
|
}
|
|
12945
13291
|
}
|
|
12946
13292
|
catch (error) {
|
|
13293
|
+
/* console.log('Entro al catch'); */
|
|
12947
13294
|
this.renderPayPal();
|
|
12948
13295
|
}
|
|
12949
13296
|
}, 1000);
|
|
@@ -16299,7 +16646,6 @@ let SidebarEcComponent = class SidebarEcComponent {
|
|
|
16299
16646
|
this.creditAccountShowPrices = null;
|
|
16300
16647
|
this.showTaxLegend = false;
|
|
16301
16648
|
this.cartLoading = false;
|
|
16302
|
-
this.enableFieldNotesInArticleFile = false;
|
|
16303
16649
|
this.getVariants = product => {
|
|
16304
16650
|
let item = product.product;
|
|
16305
16651
|
if (item.variants && item.variants.length && item.variants[0].options && item.variants[0].options.length) {
|
|
@@ -16348,11 +16694,10 @@ let SidebarEcComponent = class SidebarEcComponent {
|
|
|
16348
16694
|
this.user = u;
|
|
16349
16695
|
});
|
|
16350
16696
|
this.channelConfigService.channelConfig$.subscribe(channel => {
|
|
16351
|
-
var _a, _b, _c, _d, _e, _f
|
|
16697
|
+
var _a, _b, _c, _d, _e, _f;
|
|
16352
16698
|
this.hideDiscounts = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hideDiscounts, (_b !== null && _b !== void 0 ? _b : false));
|
|
16353
16699
|
this.hideTaxes = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.hideTaxes, (_d !== null && _d !== void 0 ? _d : false));
|
|
16354
16700
|
this.showTaxLegend = (_f = (_e = channel) === null || _e === void 0 ? void 0 : _e.showTaxLegend, (_f !== null && _f !== void 0 ? _f : false));
|
|
16355
|
-
this.enableFieldNotesInArticleFile = (_h = (_g = channel) === null || _g === void 0 ? void 0 : _g.enableFieldNotesInArticleFile, (_h !== null && _h !== void 0 ? _h : false));
|
|
16356
16701
|
});
|
|
16357
16702
|
this.cartService.showPrice$.subscribe((showPrice) => {
|
|
16358
16703
|
this.creditAccountShowPrices = showPrice;
|
|
@@ -16362,7 +16707,7 @@ let SidebarEcComponent = class SidebarEcComponent {
|
|
|
16362
16707
|
});
|
|
16363
16708
|
}
|
|
16364
16709
|
actualizarCantidad(item, cantidad, stock, id) {
|
|
16365
|
-
var _a
|
|
16710
|
+
var _a;
|
|
16366
16711
|
if (this.cartLoading) {
|
|
16367
16712
|
return;
|
|
16368
16713
|
}
|
|
@@ -16382,14 +16727,13 @@ let SidebarEcComponent = class SidebarEcComponent {
|
|
|
16382
16727
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
16383
16728
|
}
|
|
16384
16729
|
}
|
|
16385
|
-
const keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
16386
16730
|
if (id) {
|
|
16387
16731
|
const elem = document.getElementById(id);
|
|
16388
16732
|
if (elem) {
|
|
16389
16733
|
elem.disabled = true;
|
|
16390
16734
|
}
|
|
16391
16735
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
16392
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
16736
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
16393
16737
|
}
|
|
16394
16738
|
else {
|
|
16395
16739
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -16402,7 +16746,7 @@ let SidebarEcComponent = class SidebarEcComponent {
|
|
|
16402
16746
|
}
|
|
16403
16747
|
else {
|
|
16404
16748
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
16405
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
16749
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
16406
16750
|
}
|
|
16407
16751
|
}
|
|
16408
16752
|
}
|
|
@@ -16672,7 +17016,7 @@ var __decorate$21 = (this && this.__decorate) || function (decorators, target, k
|
|
|
16672
17016
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16673
17017
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16674
17018
|
};
|
|
16675
|
-
var __param$
|
|
17019
|
+
var __param$c = (this && this.__param) || function (paramIndex, decorator) {
|
|
16676
17020
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
16677
17021
|
};
|
|
16678
17022
|
class ParamsContext {
|
|
@@ -16743,7 +17087,7 @@ AddActionRedirectDirective = __decorate$21([
|
|
|
16743
17087
|
Directive({
|
|
16744
17088
|
selector: "[ecAddActionRedirect]",
|
|
16745
17089
|
}),
|
|
16746
|
-
__param$
|
|
17090
|
+
__param$c(0, Inject(DOCUMENT))
|
|
16747
17091
|
], AddActionRedirectDirective);
|
|
16748
17092
|
|
|
16749
17093
|
var __decorate$22 = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -16825,7 +17169,7 @@ var __decorate$23 = (this && this.__decorate) || function (decorators, target, k
|
|
|
16825
17169
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16826
17170
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16827
17171
|
};
|
|
16828
|
-
var __param$
|
|
17172
|
+
var __param$d = (this && this.__param) || function (paramIndex, decorator) {
|
|
16829
17173
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
16830
17174
|
};
|
|
16831
17175
|
class ParamsContext$1 {
|
|
@@ -16957,7 +17301,7 @@ ProductOffDirective = __decorate$23([
|
|
|
16957
17301
|
Directive({
|
|
16958
17302
|
selector: "[ecProductOff]",
|
|
16959
17303
|
}),
|
|
16960
|
-
__param$
|
|
17304
|
+
__param$d(0, Inject(DOCUMENT))
|
|
16961
17305
|
], ProductOffDirective);
|
|
16962
17306
|
|
|
16963
17307
|
var __decorate$24 = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -17195,7 +17539,6 @@ ecCurrencySymbolPipe.ctorParameters = () => [
|
|
|
17195
17539
|
ecCurrencySymbolPipe = __decorate$27([
|
|
17196
17540
|
Pipe({
|
|
17197
17541
|
name: 'ecCurrencySymbol',
|
|
17198
|
-
pure: false
|
|
17199
17542
|
})
|
|
17200
17543
|
], ecCurrencySymbolPipe);
|
|
17201
17544
|
|
|
@@ -17496,7 +17839,7 @@ var __decorate$2d = (this && this.__decorate) || function (decorators, target, k
|
|
|
17496
17839
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
17497
17840
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17498
17841
|
};
|
|
17499
|
-
var __param$
|
|
17842
|
+
var __param$e = (this && this.__param) || function (paramIndex, decorator) {
|
|
17500
17843
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
17501
17844
|
};
|
|
17502
17845
|
let StandardReuseStrategy = class StandardReuseStrategy {
|
|
@@ -17528,7 +17871,7 @@ StandardReuseStrategy.ctorParameters = () => [
|
|
|
17528
17871
|
];
|
|
17529
17872
|
StandardReuseStrategy = __decorate$2d([
|
|
17530
17873
|
Injectable(),
|
|
17531
|
-
__param$
|
|
17874
|
+
__param$e(0, Inject('env'))
|
|
17532
17875
|
], StandardReuseStrategy);
|
|
17533
17876
|
|
|
17534
17877
|
/*
|