ng-easycommerce-v18 0.0.3 → 0.0.5
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/assets/ec-i18n/es.json +3 -0
- package/esm2022/lib/classes/filters/PriceRangeFilter.mjs +48 -0
- package/esm2022/lib/ec-components/account-ec/order-ec/order-ec.component.mjs +75 -6
- package/esm2022/lib/ec-components/account-ec/orders-list-ec/orders-list-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/blocks-ec/block-products-ec/block-products-ec.component.mjs +1 -1
- package/esm2022/lib/ec-components/cart-ec/cart-ec.component.mjs +4 -2
- package/esm2022/lib/ec-components/cart-ec/cart-item-ec/cart-item-ec.component.mjs +77 -3
- package/esm2022/lib/ec-components/filters-ec/filters-ec.component.mjs +111 -5
- package/esm2022/lib/ec-components/index.mjs +5 -1
- package/esm2022/lib/ec-components/product-detail-ec/product-detail-ec.component.mjs +31 -1
- package/esm2022/lib/ec-components/product-ec/product-ec.component.mjs +20 -3
- package/esm2022/lib/ec-components/sidebar-ec/sidebar-ec.component.mjs +60 -0
- package/esm2022/lib/ec-components/variants-ec/variants-ec.component.mjs +3 -3
- package/esm2022/lib/ec-components/widgets-ec/index.mjs +2 -1
- package/esm2022/lib/ec-components/widgets-ec/price-ec/price-ec.component.mjs +3 -3
- package/esm2022/lib/ec-directive/index.mjs +10 -0
- package/esm2022/lib/ec-directive/product-off.directive.mjs +119 -0
- package/esm2022/lib/ec-directive/product-stock.directive.mjs +72 -0
- package/esm2022/lib/ec-services/auth.service.mjs +17 -6
- package/esm2022/lib/ec-services/cart.service.mjs +19 -2
- package/esm2022/lib/ec-services/filters.service.mjs +3 -2
- package/esm2022/lib/ec-services/ngx-local-storage.service.mjs +7 -7
- package/esm2022/lib/ec-services/orders.service.mjs +28 -1
- package/esm2022/lib/ec-services/pagination.service.mjs +8 -1
- package/esm2022/lib/ec-services/product-detail.service.mjs +1 -1
- package/esm2022/lib/ec-services/products.service.mjs +29 -1
- package/esm2022/lib/interfaces/filter.mjs +1 -1
- package/esm2022/lib/interfaces/product.mjs +1 -1
- package/esm2022/public-api.mjs +3 -1
- package/fesm2022/ng-easycommerce-v18.mjs +697 -33
- package/fesm2022/ng-easycommerce-v18.mjs.map +1 -1
- package/lib/classes/filters/PriceRangeFilter.d.ts +23 -0
- package/lib/ec-components/account-ec/order-ec/order-ec.component.d.ts +23 -1
- package/lib/ec-components/cart-ec/cart-ec.component.d.ts +2 -0
- package/lib/ec-components/cart-ec/cart-item-ec/cart-item-ec.component.d.ts +7 -1
- package/lib/ec-components/filters-ec/filters-ec.component.d.ts +30 -1
- package/lib/ec-components/index.d.ts +1 -0
- package/lib/ec-components/product-detail-ec/product-detail-ec.component.d.ts +12 -0
- package/lib/ec-components/product-ec/product-ec.component.d.ts +5 -1
- package/lib/ec-components/sidebar-ec/sidebar-ec.component.d.ts +29 -0
- package/lib/ec-directive/index.d.ts +3 -0
- package/lib/ec-directive/product-off.directive.d.ts +28 -0
- package/lib/ec-directive/product-stock.directive.d.ts +18 -0
- package/lib/ec-services/auth.service.d.ts +3 -1
- package/lib/ec-services/cart.service.d.ts +10 -1
- package/lib/ec-services/orders.service.d.ts +6 -0
- package/lib/ec-services/pagination.service.d.ts +5 -0
- package/lib/ec-services/products.service.d.ts +14 -0
- package/lib/interfaces/filter.d.ts +2 -2
- package/lib/interfaces/product.d.ts +2 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, makeEnvironmentProviders, inject, Injectable, PLATFORM_ID, RendererFactory2, afterNextRender, signal, EnvironmentInjector, runInInjectionContext, Component, CUSTOM_ELEMENTS_SCHEMA, Input, Pipe, EventEmitter, Output, forwardRef, afterRender, ViewChild } from '@angular/core';
|
|
2
|
+
import { InjectionToken, makeEnvironmentProviders, inject, Injectable, PLATFORM_ID, RendererFactory2, afterNextRender, signal, EnvironmentInjector, runInInjectionContext, Component, CUSTOM_ELEMENTS_SCHEMA, Input, Pipe, EventEmitter, Output, forwardRef, afterRender, ViewChild, Injector, Directive, Inject } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { isPlatformBrowser, DOCUMENT, AsyncPipe, CommonModule, JsonPipe, UpperCasePipe, Location, TitleCasePipe } from '@angular/common';
|
|
5
5
|
import { take, BehaviorSubject, shareReplay, map, catchError, of, filter, ReplaySubject, firstValueFrom, concatMap, switchMap, combineLatest, throwError } from 'rxjs';
|
|
@@ -12,7 +12,7 @@ import { Router, NavigationEnd, RouterLink, RouterModule, ActivatedRoute, Router
|
|
|
12
12
|
import { signalStore, withState, withMethods, patchState } from '@ngrx/signals';
|
|
13
13
|
import { ToastrService } from 'ngx-toastr';
|
|
14
14
|
import moment from 'moment';
|
|
15
|
-
import {
|
|
15
|
+
import { StorageMap } from '@ngx-pwa/local-storage';
|
|
16
16
|
import * as i1$3 from '@angular/forms';
|
|
17
17
|
import { Validators, FormBuilder, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
18
18
|
import { register } from 'swiper/element/bundle';
|
|
@@ -3283,11 +3283,12 @@ class AuthService {
|
|
|
3283
3283
|
* Chequea si un usuario esta habilitado a comprar o no.
|
|
3284
3284
|
* @returns
|
|
3285
3285
|
*/
|
|
3286
|
-
isAbleToBuy() {
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
}
|
|
3286
|
+
// isAbleToBuy():boolean {
|
|
3287
|
+
// const currentUser = this.getUserProfileAsUser() as User;
|
|
3288
|
+
// const isSeller = currentUser.typeUser && currentUser.typeUser == 'seller' || false
|
|
3289
|
+
// return !isSeller || !this.getCustomer();
|
|
3290
|
+
// }
|
|
3291
|
+
isAbleToBuy = () => !this.getUserProfileAsUser()?.isSeller() || !!this.getCustomer();
|
|
3291
3292
|
/**
|
|
3292
3293
|
* Retorna un usuario de tipo cliente.
|
|
3293
3294
|
* @returns
|
|
@@ -3374,6 +3375,16 @@ class AuthService {
|
|
|
3374
3375
|
locale: channelConfig.locale
|
|
3375
3376
|
});
|
|
3376
3377
|
};
|
|
3378
|
+
getUserProfile() {
|
|
3379
|
+
return (this._user && of(this._user)) || this.getCurrentUser();
|
|
3380
|
+
}
|
|
3381
|
+
getCurrentUser() {
|
|
3382
|
+
this._user = new User();
|
|
3383
|
+
if (!this.loadUserFromStorage()) {
|
|
3384
|
+
this._user = null;
|
|
3385
|
+
}
|
|
3386
|
+
return of(this._user);
|
|
3387
|
+
}
|
|
3377
3388
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3378
3389
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AuthService, providedIn: 'root' });
|
|
3379
3390
|
}
|
|
@@ -3448,7 +3459,7 @@ class FiltersService {
|
|
|
3448
3459
|
setFilters(paginationSettings) {
|
|
3449
3460
|
let final_filters = [];
|
|
3450
3461
|
if (this._optionsFilters?.includes('all'))
|
|
3451
|
-
this._optionsFilters = ['attributes', 'categories', 'dynamics', 'sort'];
|
|
3462
|
+
this._optionsFilters = ['attributes', 'categories', 'dynamics', 'sort', 'price_range'];
|
|
3452
3463
|
runInInjectionContext(this.environmentInjector, () => {
|
|
3453
3464
|
const filterFactory = new FilterFactory();
|
|
3454
3465
|
this._optionsFilters?.forEach(filter => final_filters.push(filterFactory.create(filter, paginationSettings)));
|
|
@@ -3458,6 +3469,7 @@ class FiltersService {
|
|
|
3458
3469
|
filter && filterDefault.codes.forEach(value => filter.setSelected(value));
|
|
3459
3470
|
});
|
|
3460
3471
|
this._filtersSubject.next(final_filters);
|
|
3472
|
+
// case 'price_range': instance = new PriceRangeFilter(); break; COMO ADAPTO ESTE CODIGO A LA NUEVA ESTRUCTURA DE FILTROS
|
|
3461
3473
|
}
|
|
3462
3474
|
/**
|
|
3463
3475
|
* Obtengo filtros especificos según el tipo.
|
|
@@ -3544,6 +3556,8 @@ class PaginationService {
|
|
|
3544
3556
|
nextProducts$ = this._nextProductsSubject.asObservable();
|
|
3545
3557
|
_resetSubject = new BehaviorSubject(false);
|
|
3546
3558
|
reset$ = this._resetSubject.asObservable();
|
|
3559
|
+
priceRangeSubject = new BehaviorSubject({ price_min: 0, price_max: 0 });
|
|
3560
|
+
priceRange$ = this.priceRangeSubject.asObservable();
|
|
3547
3561
|
constructor() { }
|
|
3548
3562
|
/**
|
|
3549
3563
|
* Inicializa la configuración para el Servicio de Paginación.
|
|
@@ -3589,6 +3603,11 @@ class PaginationService {
|
|
|
3589
3603
|
this._dataPagination.set({ ...response, called: true });
|
|
3590
3604
|
this._finished = (response.page == response.pages);
|
|
3591
3605
|
this._waiting = false;
|
|
3606
|
+
// Emitir los valores de price_min y price_max a través de priceRangeSubject
|
|
3607
|
+
// this.priceRangeSubject.next({
|
|
3608
|
+
// price_min: response.price_min,
|
|
3609
|
+
// price_max: response.price_max
|
|
3610
|
+
// });
|
|
3592
3611
|
}
|
|
3593
3612
|
/**
|
|
3594
3613
|
* Marca el final de las paginas, es decir cuando ya no queda mas elementos que mostrar.
|
|
@@ -3671,6 +3690,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
3671
3690
|
}]
|
|
3672
3691
|
}], ctorParameters: () => [] });
|
|
3673
3692
|
|
|
3693
|
+
class PriceRangeFilter extends Filter {
|
|
3694
|
+
minPrice = 0;
|
|
3695
|
+
maxPrice = 1000;
|
|
3696
|
+
currentMinPrice = null;
|
|
3697
|
+
currentMaxPrice = null;
|
|
3698
|
+
type = () => 'price_range';
|
|
3699
|
+
// Método para configurar el rango de precios inicial
|
|
3700
|
+
setContent = (options) => {
|
|
3701
|
+
this.minPrice = options.minPrice || this.minPrice;
|
|
3702
|
+
this.maxPrice = options.maxPrice || this.maxPrice;
|
|
3703
|
+
this.currentMinPrice = options.currentMinPrice || this.minPrice;
|
|
3704
|
+
this.currentMaxPrice = options.currentMaxPrice || this.maxPrice;
|
|
3705
|
+
};
|
|
3706
|
+
updatePrices(min, max) {
|
|
3707
|
+
this.minPrice = min;
|
|
3708
|
+
this.maxPrice = max;
|
|
3709
|
+
}
|
|
3710
|
+
// Método para actualizar los valores seleccionados
|
|
3711
|
+
setSelected = (min, max) => {
|
|
3712
|
+
this.currentMinPrice = min;
|
|
3713
|
+
this.currentMaxPrice = max;
|
|
3714
|
+
};
|
|
3715
|
+
// Retorna los valores seleccionados (rango de precios)
|
|
3716
|
+
getSelectedRange = () => {
|
|
3717
|
+
return {
|
|
3718
|
+
min: this.currentMinPrice || this.minPrice,
|
|
3719
|
+
max: this.currentMaxPrice || this.maxPrice,
|
|
3720
|
+
};
|
|
3721
|
+
};
|
|
3722
|
+
// Genera los parámetros de la URL en base al rango de precios seleccionado
|
|
3723
|
+
toUrlParams = () => {
|
|
3724
|
+
let params = '';
|
|
3725
|
+
if (this.currentMinPrice !== null) {
|
|
3726
|
+
params += `&price_min=${this.currentMinPrice}`;
|
|
3727
|
+
}
|
|
3728
|
+
if (this.currentMaxPrice !== null) {
|
|
3729
|
+
params += `&price_max=${this.currentMaxPrice}`;
|
|
3730
|
+
}
|
|
3731
|
+
return params;
|
|
3732
|
+
};
|
|
3733
|
+
// Restablece el filtro a los valores por defecto
|
|
3734
|
+
reset = () => {
|
|
3735
|
+
this.currentMinPrice = 0;
|
|
3736
|
+
this.currentMaxPrice = this.maxPrice;
|
|
3737
|
+
};
|
|
3738
|
+
}
|
|
3739
|
+
|
|
3740
|
+
;
|
|
3674
3741
|
class ProductsService {
|
|
3675
3742
|
_connection = inject(ConnectionService);
|
|
3676
3743
|
_apiConsts = inject(ApiConstantsService);
|
|
@@ -3680,6 +3747,8 @@ class ProductsService {
|
|
|
3680
3747
|
_productsSubject = new BehaviorSubject([]);
|
|
3681
3748
|
products$ = this._productsSubject.asObservable();
|
|
3682
3749
|
_filtersService = inject(FiltersService);
|
|
3750
|
+
filtersSubject = new BehaviorSubject([]);
|
|
3751
|
+
filters$ = this.filtersSubject.asObservable();
|
|
3683
3752
|
searchValue = signal('');
|
|
3684
3753
|
constructor() {
|
|
3685
3754
|
this._paginationService.reset$.subscribe(res => {
|
|
@@ -3692,10 +3761,18 @@ class ProductsService {
|
|
|
3692
3761
|
const currentProducts = this._productsSubject.value;
|
|
3693
3762
|
this._productsSubject.next([...currentProducts, ...products]);
|
|
3694
3763
|
});
|
|
3764
|
+
// Suscribirse a los cambios en el rango de precios
|
|
3765
|
+
this._paginationService.priceRange$.subscribe(range => {
|
|
3766
|
+
this.updatePriceRangeFilter(range.price_min, range.price_max);
|
|
3767
|
+
});
|
|
3695
3768
|
}
|
|
3696
3769
|
//API URL
|
|
3697
3770
|
_shopApiUrl = this._apiConsts.SHOP_API_URL;
|
|
3698
3771
|
productByCodeApi(code, variant) { return this._shopApiUrl + this._apiConsts.CHANNEL + '/products/by-code/' + (variant ? 'variant/' : '') + code + '?locale=' + this._apiConsts.LOCALE; }
|
|
3772
|
+
// review
|
|
3773
|
+
saveProductReviewsApi(code) { return this._shopApiUrl + this._apiConsts.CHANNEL + '/products/by-code/' + code + '/reviews'; }
|
|
3774
|
+
//related products
|
|
3775
|
+
relatedProductsApi = (key) => 'shop-api/' + this._apiConsts.CHANNEL + '/products/related/by-code/' + key + '?locale=' + this._apiConsts.LOCALE;
|
|
3699
3776
|
/**
|
|
3700
3777
|
* Setea los filtros para obtener los productos.
|
|
3701
3778
|
* @param paginationSettings
|
|
@@ -3722,6 +3799,13 @@ class ProductsService {
|
|
|
3722
3799
|
getProductByCode(code, variant) {
|
|
3723
3800
|
return this._connection.get(this.productByCodeApi(code, variant));
|
|
3724
3801
|
}
|
|
3802
|
+
/**
|
|
3803
|
+
* @description Guarda la reseña de un producto.
|
|
3804
|
+
* @param code
|
|
3805
|
+
* @param form_data
|
|
3806
|
+
* @returns
|
|
3807
|
+
*/
|
|
3808
|
+
saveReviews = (code, form_data) => this._connection.post(this.saveProductReviewsApi(code), form_data);
|
|
3725
3809
|
/**
|
|
3726
3810
|
* Recibe una lista de productos y retorna los mismos productos tantas veces como variantes tenga.
|
|
3727
3811
|
* cada producto retornado tendrá una única variante.
|
|
@@ -3801,6 +3885,15 @@ class ProductsService {
|
|
|
3801
3885
|
getObjectWithVariant = () => {
|
|
3802
3886
|
return this._consts.getParamsProductsWithUniqueVariant();
|
|
3803
3887
|
};
|
|
3888
|
+
updatePriceRangeFilter(min, max) {
|
|
3889
|
+
const final_filters = this.filtersSubject.value;
|
|
3890
|
+
const priceRangeFilter = final_filters.find(filter => filter instanceof PriceRangeFilter);
|
|
3891
|
+
if (priceRangeFilter) {
|
|
3892
|
+
priceRangeFilter.updatePrices(min, max);
|
|
3893
|
+
this.filtersSubject.next(final_filters);
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3896
|
+
getRelatedProducts = (key) => this._connection.get(this.relatedProductsApi(key));
|
|
3804
3897
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ProductsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3805
3898
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ProductsService, providedIn: 'root' });
|
|
3806
3899
|
}
|
|
@@ -3820,11 +3913,11 @@ class NgxLocalStorageService {
|
|
|
3820
3913
|
/**
|
|
3821
3914
|
* Servicio usado para guardar los datos en el localstorage.
|
|
3822
3915
|
*/
|
|
3823
|
-
_storage = inject(
|
|
3916
|
+
_storage = inject(StorageMap);
|
|
3824
3917
|
constructor() { }
|
|
3825
3918
|
getItemPromise(key) {
|
|
3826
3919
|
return new Promise((resolve, reject) => {
|
|
3827
|
-
this._storage.
|
|
3920
|
+
this._storage.get(key).subscribe({
|
|
3828
3921
|
next: (data) => resolve(data),
|
|
3829
3922
|
error: (err) => reject(err),
|
|
3830
3923
|
});
|
|
@@ -3836,7 +3929,7 @@ class NgxLocalStorageService {
|
|
|
3836
3929
|
* @returns
|
|
3837
3930
|
*/
|
|
3838
3931
|
getItem(key) {
|
|
3839
|
-
return this._storage.
|
|
3932
|
+
return this._storage.get(key);
|
|
3840
3933
|
}
|
|
3841
3934
|
/**
|
|
3842
3935
|
* Guarda un dato en el storage.
|
|
@@ -3845,7 +3938,7 @@ class NgxLocalStorageService {
|
|
|
3845
3938
|
* @param metadata Opciones extra que puede necesitar el servicio.
|
|
3846
3939
|
*/
|
|
3847
3940
|
setItem(key, value, metadata = { path: '/' }) {
|
|
3848
|
-
this._storage.
|
|
3941
|
+
this._storage.set(key, value).subscribe(() => { });
|
|
3849
3942
|
}
|
|
3850
3943
|
/**
|
|
3851
3944
|
* Remueve el item del storage.
|
|
@@ -3853,7 +3946,7 @@ class NgxLocalStorageService {
|
|
|
3853
3946
|
* @param metadata Opciones extra que puede necesitar el servicio.
|
|
3854
3947
|
*/
|
|
3855
3948
|
removeItem(key, metadata) {
|
|
3856
|
-
this._storage.
|
|
3949
|
+
this._storage.delete(key).subscribe(() => { });
|
|
3857
3950
|
}
|
|
3858
3951
|
/**
|
|
3859
3952
|
* Limpia el Storage.
|
|
@@ -3896,6 +3989,8 @@ class CartService {
|
|
|
3896
3989
|
showMax: false,
|
|
3897
3990
|
showPrice: false,
|
|
3898
3991
|
remainingCredits: 0,
|
|
3992
|
+
applyMaxOrders: false,
|
|
3993
|
+
maxOrders: Infinity
|
|
3899
3994
|
});
|
|
3900
3995
|
CART_KEY = 'cart';
|
|
3901
3996
|
CART_TOKEN_KEY = 'cart_token';
|
|
@@ -3909,6 +4004,13 @@ class CartService {
|
|
|
3909
4004
|
cart$ = this._cartSubject.asObservable();
|
|
3910
4005
|
loading$ = this._requestInProcess.asObservable();
|
|
3911
4006
|
_haveToUpdate = true;
|
|
4007
|
+
balanceCustomer$ = this._balanceCustomerSubject.asObservable();
|
|
4008
|
+
allowAnyPaymentMethod$ = this.balanceCustomer$.pipe(map(data => data.allowAnyPaymentMethod));
|
|
4009
|
+
allowExceedBalance$ = this.balanceCustomer$.pipe(map(data => data.allowExceedBalance));
|
|
4010
|
+
creditAmount$ = this.balanceCustomer$.pipe(map(data => data.creditAmount));
|
|
4011
|
+
showMax$ = this.balanceCustomer$.pipe(map(data => data.showMax));
|
|
4012
|
+
showPrice$ = this.balanceCustomer$.pipe(map(data => data.showPrice));
|
|
4013
|
+
promotions$ = this._promotionsSubject.asObservable();
|
|
3912
4014
|
//API URL
|
|
3913
4015
|
_cartBaseUrl = `${this._apiConsts.SHOP_API_URL}${this._apiConsts.CHANNEL}/carts`;
|
|
3914
4016
|
updateItemQuantityApi(item_id) { return this._cartBaseUrl + '/' + this.cartToken + '/items/' + item_id + '?locale=' + this._apiConsts.LOCALE; }
|
|
@@ -3979,7 +4081,11 @@ class CartService {
|
|
|
3979
4081
|
* @returns
|
|
3980
4082
|
*/
|
|
3981
4083
|
addToCart(product, quantity, variantId) {
|
|
3982
|
-
|
|
4084
|
+
const balance = this._balanceCustomerSubject.value;
|
|
4085
|
+
if (balance.applyMaxOrders && (balance.maxOrders && (balance.maxOrders <= 0 || balance.maxOrders === null))) {
|
|
4086
|
+
this._toastService.show('max-orders-reached');
|
|
4087
|
+
return;
|
|
4088
|
+
}
|
|
3983
4089
|
if (!this._authService.isAbleToBuy()) {
|
|
3984
4090
|
this._toastService.show('must-select-customer');
|
|
3985
4091
|
return;
|
|
@@ -4302,6 +4408,8 @@ class CartService {
|
|
|
4302
4408
|
remainingCredits: cartData?.creditAmount && cartData?.creditAmount >= cartData?.totals.total
|
|
4303
4409
|
? cartData?.creditAmount - cartData?.totals.total
|
|
4304
4410
|
: 0,
|
|
4411
|
+
applyMaxOrders: cartData?.applyMaxOrders ?? false,
|
|
4412
|
+
maxOrders: cartData?.maxOrders ?? Infinity
|
|
4305
4413
|
};
|
|
4306
4414
|
this._balanceCustomerSubject.next(balanceData);
|
|
4307
4415
|
console.log(balanceData);
|
|
@@ -4318,6 +4426,8 @@ class CartService {
|
|
|
4318
4426
|
error: (err) => this.handleError(err)
|
|
4319
4427
|
});
|
|
4320
4428
|
}
|
|
4429
|
+
getCreditAmount = () => this._balanceCustomerSubject.pipe(map((balanceCustomer) => balanceCustomer?.creditAmount ?? null));
|
|
4430
|
+
getRemainingCredits = () => this._balanceCustomerSubject.pipe(map((balanceCustomer) => balanceCustomer?.remainingCredits));
|
|
4321
4431
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4322
4432
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CartService, providedIn: 'root' });
|
|
4323
4433
|
}
|
|
@@ -5243,10 +5353,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
5243
5353
|
class OrdersService {
|
|
5244
5354
|
_connection = inject(ConnectionService);
|
|
5245
5355
|
_apiConsts = inject(ApiConstantsService);
|
|
5356
|
+
_cartService = inject(CartService);
|
|
5246
5357
|
_ordersSubject = new BehaviorSubject(null);
|
|
5247
5358
|
_errorSubject = new BehaviorSubject(null);
|
|
5359
|
+
_selectedOrderSubject = new BehaviorSubject(null);
|
|
5248
5360
|
orders$ = this._ordersSubject.asObservable();
|
|
5361
|
+
selectedOrder$ = this._selectedOrderSubject.asObservable();
|
|
5249
5362
|
loading = false;
|
|
5363
|
+
channelConfig = {};
|
|
5250
5364
|
//API URL
|
|
5251
5365
|
ordersListapi() { return `shop-api/${this._apiConsts.CHANNEL}/orders`; }
|
|
5252
5366
|
;
|
|
@@ -5273,6 +5387,28 @@ class OrdersService {
|
|
|
5273
5387
|
return order;
|
|
5274
5388
|
});
|
|
5275
5389
|
}
|
|
5390
|
+
setSelectedOrder(order) {
|
|
5391
|
+
this._selectedOrderSubject.next(order);
|
|
5392
|
+
this.channelConfig = (this._cartService.channelConfig);
|
|
5393
|
+
}
|
|
5394
|
+
getOrderByNumber(number) {
|
|
5395
|
+
this.loading = true;
|
|
5396
|
+
this._connection.get(this.ordersListapi())
|
|
5397
|
+
.pipe(map(res => {
|
|
5398
|
+
let orders = this.mapOrdersAndAddInfo(res);
|
|
5399
|
+
const order = orders.find((order) => order.number == number);
|
|
5400
|
+
return order;
|
|
5401
|
+
}))
|
|
5402
|
+
.subscribe({
|
|
5403
|
+
next: (response) => {
|
|
5404
|
+
this._selectedOrderSubject.next(response);
|
|
5405
|
+
this.loading = false;
|
|
5406
|
+
},
|
|
5407
|
+
error: (e) => {
|
|
5408
|
+
this._errorSubject.next({ message: 'unable-get-orders' });
|
|
5409
|
+
}
|
|
5410
|
+
});
|
|
5411
|
+
}
|
|
5276
5412
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: OrdersService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
5277
5413
|
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: OrdersService, providedIn: 'root' });
|
|
5278
5414
|
}
|
|
@@ -5847,11 +5983,11 @@ class PriceEcComponent {
|
|
|
5847
5983
|
*/
|
|
5848
5984
|
saleprice;
|
|
5849
5985
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: PriceEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5850
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: PriceEcComponent, isStandalone: true, selector: "app-price-ec", inputs: { price: "price", saleprice: "saleprice" }, ngImport: i0, template: "@if(saleprice){\r\n <!--With saleprice-->\r\n
|
|
5986
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: PriceEcComponent, isStandalone: true, selector: "app-price-ec", inputs: { price: "price", saleprice: "saleprice" }, ngImport: i0, template: " <div class=\"price\">\r\n @if(saleprice){\r\n <!--With saleprice-->\r\n \r\n @if(price && price.split(' - ').length > 1){\r\n <div class=\"price-whithSaleprice\">\r\n <del class=\"\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </del>\r\n </div>\r\n }@else {\r\n <!--Simple Price Del-->\r\n <div class=\"price-simpleDel\">\r\n <del class=\"\">\r\n {{ price | ecCurrencySymbol }}</del>\r\n </div>\r\n }\r\n @if(saleprice && saleprice.split(' - ').length > 1){\r\n <div class=\"\">\r\n {{\r\n saleprice.split(' - ')[0] | ecCurrencySymbol\r\n }}\r\n {{\r\n saleprice.split(' - ')[1] | ecCurrencySymbol\r\n }}\r\n </div>\r\n } @else {\r\n <!--Simple saleprice-->\r\n <div class=\"price-simpleSaleprice\">\r\n {{ saleprice | ecCurrencySymbol }}\r\n </div>\r\n }\r\n\r\n}@else {\r\n <!--Only Price-->\r\n\r\n @if(price && price.split(' - ').length > 1){\r\n <div class=\"price-onlyPrice\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }} -\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </div> \r\n } @else {\r\n <!--Simple price-->\r\n <del> </del>\r\n <div class=\"price-simplePrice\">\r\n {{ price | ecCurrencySymbol }}\r\n </div>\r\n }\r\n}\r\n</div> ", styles: [""], dependencies: [{ kind: "pipe", type: EcCurrencySymbolPipe, name: "ecCurrencySymbol" }] });
|
|
5851
5987
|
}
|
|
5852
5988
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: PriceEcComponent, decorators: [{
|
|
5853
5989
|
type: Component,
|
|
5854
|
-
args: [{ selector: 'app-price-ec', standalone: true, imports: [EcCurrencySymbolPipe], template: "@if(saleprice){\r\n <!--With saleprice-->\r\n
|
|
5990
|
+
args: [{ selector: 'app-price-ec', standalone: true, imports: [EcCurrencySymbolPipe], template: " <div class=\"price\">\r\n @if(saleprice){\r\n <!--With saleprice-->\r\n \r\n @if(price && price.split(' - ').length > 1){\r\n <div class=\"price-whithSaleprice\">\r\n <del class=\"\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </del>\r\n </div>\r\n }@else {\r\n <!--Simple Price Del-->\r\n <div class=\"price-simpleDel\">\r\n <del class=\"\">\r\n {{ price | ecCurrencySymbol }}</del>\r\n </div>\r\n }\r\n @if(saleprice && saleprice.split(' - ').length > 1){\r\n <div class=\"\">\r\n {{\r\n saleprice.split(' - ')[0] | ecCurrencySymbol\r\n }}\r\n {{\r\n saleprice.split(' - ')[1] | ecCurrencySymbol\r\n }}\r\n </div>\r\n } @else {\r\n <!--Simple saleprice-->\r\n <div class=\"price-simpleSaleprice\">\r\n {{ saleprice | ecCurrencySymbol }}\r\n </div>\r\n }\r\n\r\n}@else {\r\n <!--Only Price-->\r\n\r\n @if(price && price.split(' - ').length > 1){\r\n <div class=\"price-onlyPrice\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }} -\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </div> \r\n } @else {\r\n <!--Simple price-->\r\n <del> </del>\r\n <div class=\"price-simplePrice\">\r\n {{ price | ecCurrencySymbol }}\r\n </div>\r\n }\r\n}\r\n</div> " }]
|
|
5855
5991
|
}], propDecorators: { price: [{
|
|
5856
5992
|
type: Input
|
|
5857
5993
|
}], saleprice: [{
|
|
@@ -5875,6 +6011,7 @@ class ProductEcComponent {
|
|
|
5875
6011
|
* Constantes del core
|
|
5876
6012
|
*/
|
|
5877
6013
|
loaded = new EventEmitter();
|
|
6014
|
+
isCollection = false;
|
|
5878
6015
|
ngOnInit() {
|
|
5879
6016
|
this.loaded.emit(this.product.id);
|
|
5880
6017
|
}
|
|
@@ -5885,12 +6022,23 @@ class ProductEcComponent {
|
|
|
5885
6022
|
* URL para las imagenes del producto.
|
|
5886
6023
|
*/
|
|
5887
6024
|
mediaUrl = this.consts.mediaUrl();
|
|
6025
|
+
openWhatsApp(url) {
|
|
6026
|
+
if (url) {
|
|
6027
|
+
window.open(url, '_blank');
|
|
6028
|
+
}
|
|
6029
|
+
}
|
|
6030
|
+
get shouldShowPrice() {
|
|
6031
|
+
return !this.product?.special_mark || this.product.special_mark.length === 0 || this.product.special_mark[0]?.showPrice;
|
|
6032
|
+
}
|
|
6033
|
+
get hasDiscount() {
|
|
6034
|
+
return this.product.saleprice && this.product.saleprice !== this.product.price;
|
|
6035
|
+
}
|
|
5888
6036
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ProductEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5889
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: ProductEcComponent, isStandalone: true, selector: "app-product-ec", inputs: { product: "product", isProductBox: "isProductBox" }, outputs: { loaded: "loaded" }, ngImport: i0, template: "
|
|
6037
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: ProductEcComponent, isStandalone: true, selector: "app-product-ec", inputs: { product: "product", isProductBox: "isProductBox", isCollection: "isCollection" }, outputs: { loaded: "loaded" }, ngImport: i0, template: "<a [routerLink]=\"['/product', product.id]\" class=\"text-decoration-none\">\r\n <!-- Marca especial y descuento -->\r\n <!-- <div *ngIf=\"product.saleprice || (product.special_mark && product.special_mark !== null && product.special_mark !== undefined && product.special_mark.length >0)\"\r\n class=\"marcas\">\r\n <div *ecProductStock=\"product\" [ecProductMini]=\"product.special_mark\"></div>\r\n <ng-container *ngIf=\"shouldShowPrice\">\r\n <div *ecProductStock=\"product\" [ngClass]=\"{'tag-dsc float-right': product.saleprice}\"\r\n [ecProductOff]=\"product\">\r\n </div>\r\n </ng-container>\r\n </div> -->\r\n\r\n <!-- Imagen del producto -->\r\n <div class=\"foto\">\r\n @if(product.picturesdefault){\r\n @if (product.picturesdefault && product.picturesdefault.length > 1 ) {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n <img [src]=\"mediaUrl + product.picturesdefault[1]\" alt=\"Imagen secundaria\" class=\"w-100 pic02\" />\r\n } @else {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n }\r\n }\r\n </div>\r\n <!-- Precio -->\r\n \r\n\r\n <!-- Nombre del producto -->\r\n <h6 class=\"title\">{{ product.name | titlecase }}</h6>\r\n\r\n <div class=\"sku\" [innerHTML]=\"product.shortdetails\"></div>\r\n \r\n @if (shouldShowPrice) {\r\n <app-price-ec [price]=\"product.price\" [saleprice]=\"product.saleprice\" class=\"\" />\r\n }@else {\r\n <p class=\"noPrice\"></p>\r\n }\r\n\r\n <div class=\"fixBottom\">\r\n\r\n <!-- Bot\u00F3n de acciones -->\r\n <!-- <ng-container *ecProductStock=\"product; else noStock\"> -->\r\n <!-- Cuando no tiene marca especial o es de tipo 'standard' -->\r\n @if (!product.special_mark || product.special_mark.length === 0 || product.special_mark[0]?.type ===\r\n 'standard') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n <ng-container *ngIf=\"isCollection; else normalText\">\r\n <span> {{(\"buy\" | translate) | uppercase}} </span>\r\n </ng-container>\r\n <ng-template #normalText>\r\n {{(\"buy\" | translate) | uppercase}}\r\n </ng-template>\r\n </button>\r\n }\r\n <!-- Cuando tiene marca especial y el tipo no es 'standard' -->\r\n @if(product.special_mark?.[0]?.type !== 'standard'){\r\n @for (item of product.special_mark; track $index) {\r\n <!-- Caso 1: Agotado o Disponible muy pronto -->\r\n @if (item.type === 'out_of_stock' || item.type === 'coming_soon') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ item.name | uppercase }} </span>\r\n }@else {\r\n {{ item.name | uppercase }}\r\n }\r\n </button>}\r\n <!-- Caso 2: Contacto por WhatsApp -->\r\n @if (item.type === 'whatsapp_contact') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\"\r\n (click)=\"openWhatsApp(item.whatsappContact)\">\r\n @if(isCollection){\r\n <span>{{ item.name | uppercase }}</span>\r\n }@else {\r\n {{ item.name | uppercase }}\r\n }\r\n\r\n </button>\r\n }\r\n <!-- Caso 3: Solicitar m\u00E1s informaci\u00F3n -->\r\n @if (item.type === 'more_info') {\r\n <button *ngIf=\"\" class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ item.name | uppercase }}</span>\r\n }@else {\r\n {{ item.name | uppercase }}\r\n }\r\n </button>\r\n }\r\n\r\n }\r\n }\r\n\r\n <!-- </ng-container>\r\n <ng-template #noStock>\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n <ng-container *ngIf=\"isCollection; else normalText\">\r\n <span>{{(\"out-of-stock-short\" | translate) | uppercase}}</span>\r\n </ng-container>\r\n <ng-template #normalText>\r\n {{(\"out-of-stock-short\" | translate) | uppercase}}\r\n </ng-template>\r\n </button>\r\n </ng-template> -->\r\n </div>\r\n</a>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }, { kind: "component", type: PriceEcComponent, selector: "app-price-ec", inputs: ["price", "saleprice"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }] });
|
|
5890
6038
|
}
|
|
5891
6039
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ProductEcComponent, decorators: [{
|
|
5892
6040
|
type: Component,
|
|
5893
|
-
args: [{ selector: 'app-product-ec', standalone: true, imports: [CommonModule, PriceEcComponent, RouterLink], template: "
|
|
6041
|
+
args: [{ selector: 'app-product-ec', standalone: true, imports: [CommonModule, PriceEcComponent, RouterLink, TranslateModule], template: "<a [routerLink]=\"['/product', product.id]\" class=\"text-decoration-none\">\r\n <!-- Marca especial y descuento -->\r\n <!-- <div *ngIf=\"product.saleprice || (product.special_mark && product.special_mark !== null && product.special_mark !== undefined && product.special_mark.length >0)\"\r\n class=\"marcas\">\r\n <div *ecProductStock=\"product\" [ecProductMini]=\"product.special_mark\"></div>\r\n <ng-container *ngIf=\"shouldShowPrice\">\r\n <div *ecProductStock=\"product\" [ngClass]=\"{'tag-dsc float-right': product.saleprice}\"\r\n [ecProductOff]=\"product\">\r\n </div>\r\n </ng-container>\r\n </div> -->\r\n\r\n <!-- Imagen del producto -->\r\n <div class=\"foto\">\r\n @if(product.picturesdefault){\r\n @if (product.picturesdefault && product.picturesdefault.length > 1 ) {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n <img [src]=\"mediaUrl + product.picturesdefault[1]\" alt=\"Imagen secundaria\" class=\"w-100 pic02\" />\r\n } @else {\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"Imagen principal\" class=\"w-100 pic01\" />\r\n }\r\n }\r\n </div>\r\n <!-- Precio -->\r\n \r\n\r\n <!-- Nombre del producto -->\r\n <h6 class=\"title\">{{ product.name | titlecase }}</h6>\r\n\r\n <div class=\"sku\" [innerHTML]=\"product.shortdetails\"></div>\r\n \r\n @if (shouldShowPrice) {\r\n <app-price-ec [price]=\"product.price\" [saleprice]=\"product.saleprice\" class=\"\" />\r\n }@else {\r\n <p class=\"noPrice\"></p>\r\n }\r\n\r\n <div class=\"fixBottom\">\r\n\r\n <!-- Bot\u00F3n de acciones -->\r\n <!-- <ng-container *ecProductStock=\"product; else noStock\"> -->\r\n <!-- Cuando no tiene marca especial o es de tipo 'standard' -->\r\n @if (!product.special_mark || product.special_mark.length === 0 || product.special_mark[0]?.type ===\r\n 'standard') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n <ng-container *ngIf=\"isCollection; else normalText\">\r\n <span> {{(\"buy\" | translate) | uppercase}} </span>\r\n </ng-container>\r\n <ng-template #normalText>\r\n {{(\"buy\" | translate) | uppercase}}\r\n </ng-template>\r\n </button>\r\n }\r\n <!-- Cuando tiene marca especial y el tipo no es 'standard' -->\r\n @if(product.special_mark?.[0]?.type !== 'standard'){\r\n @for (item of product.special_mark; track $index) {\r\n <!-- Caso 1: Agotado o Disponible muy pronto -->\r\n @if (item.type === 'out_of_stock' || item.type === 'coming_soon') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ item.name | uppercase }} </span>\r\n }@else {\r\n {{ item.name | uppercase }}\r\n }\r\n </button>}\r\n <!-- Caso 2: Contacto por WhatsApp -->\r\n @if (item.type === 'whatsapp_contact') {\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\"\r\n (click)=\"openWhatsApp(item.whatsappContact)\">\r\n @if(isCollection){\r\n <span>{{ item.name | uppercase }}</span>\r\n }@else {\r\n {{ item.name | uppercase }}\r\n }\r\n\r\n </button>\r\n }\r\n <!-- Caso 3: Solicitar m\u00E1s informaci\u00F3n -->\r\n @if (item.type === 'more_info') {\r\n <button *ngIf=\"\" class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n @if(isCollection){\r\n <span>{{ item.name | uppercase }}</span>\r\n }@else {\r\n {{ item.name | uppercase }}\r\n }\r\n </button>\r\n }\r\n\r\n }\r\n }\r\n\r\n <!-- </ng-container>\r\n <ng-template #noStock>\r\n <button class=\"btn\" [ngClass]=\"isCollection ? 'px-2 w-100 d-sm-block' : 'py-2 px-4'\">\r\n <ng-container *ngIf=\"isCollection; else normalText\">\r\n <span>{{(\"out-of-stock-short\" | translate) | uppercase}}</span>\r\n </ng-container>\r\n <ng-template #normalText>\r\n {{(\"out-of-stock-short\" | translate) | uppercase}}\r\n </ng-template>\r\n </button>\r\n </ng-template> -->\r\n </div>\r\n</a>" }]
|
|
5894
6042
|
}], propDecorators: { product: [{
|
|
5895
6043
|
type: Input,
|
|
5896
6044
|
args: [{
|
|
@@ -5900,6 +6048,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
5900
6048
|
type: Input
|
|
5901
6049
|
}], loaded: [{
|
|
5902
6050
|
type: Output
|
|
6051
|
+
}], isCollection: [{
|
|
6052
|
+
type: Input
|
|
5903
6053
|
}] } });
|
|
5904
6054
|
|
|
5905
6055
|
register();
|
|
@@ -5983,7 +6133,7 @@ class BlockProductsEcComponent extends BlockEcComponent {
|
|
|
5983
6133
|
this.analyticsService.callEvent('select_promotion', item);
|
|
5984
6134
|
}
|
|
5985
6135
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: BlockProductsEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
5986
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: BlockProductsEcComponent, isStandalone: true, selector: "app-block-products-ec", inputs: { appProduct: "appProduct", products: "products", meta: "meta" }, usesInheritance: true, ngImport: i0, template: "<section [ngClass]=\"trimClassBlock(meta.code) + ' container-fluid'\">\r\n\r\n <div class=\"blockProduct block-product\">\r\n @if(meta.name){\r\n <div class=\"row\">\r\n <div class=\"col-12 mt-4\">\r\n <h2 class=\"font-weight-normal font-gd\">\r\n <span>{{meta.name}}</span>\r\n </h2>\r\n </div>\r\n </div>\r\n }\r\n\r\n\r\n @if(meta.styles && meta.styles.carrousel == false){\r\n <div class=\"row \">\r\n @for (product of products; track $index) {\r\n <div [class]=\"'item '+ ' col-'+ (meta.styles.items?.sm) + ' col-md-' + (meta.styles.items?.md) + ' col-lg-' + (meta.styles.items?.lg) + ' px-2'\" [id]=\"$index\">\r\n <!-- verifica que si vienen un template para un custom appProduct llamado \"appProduct\" con un objeto \"product\"- sino usa por defecto el del core -->\r\n <ng-container *ngTemplateOutlet=\"appProduct ? appProduct : defaultAppProduct; context: {product:product}\"></ng-container> \r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <swiper-container init=\"false\" [id]=\"meta?.code\">\r\n @for (product of products; track $index) {\r\n <swiper-slide>\r\n <ng-container *ngTemplateOutlet=\"appProduct ? appProduct : defaultAppProduct; context: {product:product}\"></ng-container> \r\n </swiper-slide>\r\n }\r\n </swiper-container>\r\n }\r\n </div>\r\n</section>\r\n\r\n\r\n<!-- componente por defecto (tomara como producto el contexto pasado como \"product\") -->\r\n<ng-template #defaultAppProduct let-product=\"product\" > \r\n <app-product-ec [product]=\"product\"></app-product-ec>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ProductEcComponent, selector: "app-product-ec", inputs: ["product", "isProductBox"], outputs: ["loaded"] }] });
|
|
6136
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: BlockProductsEcComponent, isStandalone: true, selector: "app-block-products-ec", inputs: { appProduct: "appProduct", products: "products", meta: "meta" }, usesInheritance: true, ngImport: i0, template: "<section [ngClass]=\"trimClassBlock(meta.code) + ' container-fluid'\">\r\n\r\n <div class=\"blockProduct block-product\">\r\n @if(meta.name){\r\n <div class=\"row\">\r\n <div class=\"col-12 mt-4\">\r\n <h2 class=\"font-weight-normal font-gd\">\r\n <span>{{meta.name}}</span>\r\n </h2>\r\n </div>\r\n </div>\r\n }\r\n\r\n\r\n @if(meta.styles && meta.styles.carrousel == false){\r\n <div class=\"row \">\r\n @for (product of products; track $index) {\r\n <div [class]=\"'item '+ ' col-'+ (meta.styles.items?.sm) + ' col-md-' + (meta.styles.items?.md) + ' col-lg-' + (meta.styles.items?.lg) + ' px-2'\" [id]=\"$index\">\r\n <!-- verifica que si vienen un template para un custom appProduct llamado \"appProduct\" con un objeto \"product\"- sino usa por defecto el del core -->\r\n <ng-container *ngTemplateOutlet=\"appProduct ? appProduct : defaultAppProduct; context: {product:product}\"></ng-container> \r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n <swiper-container init=\"false\" [id]=\"meta?.code\">\r\n @for (product of products; track $index) {\r\n <swiper-slide>\r\n <ng-container *ngTemplateOutlet=\"appProduct ? appProduct : defaultAppProduct; context: {product:product}\"></ng-container> \r\n </swiper-slide>\r\n }\r\n </swiper-container>\r\n }\r\n </div>\r\n</section>\r\n\r\n\r\n<!-- componente por defecto (tomara como producto el contexto pasado como \"product\") -->\r\n<ng-template #defaultAppProduct let-product=\"product\" > \r\n <app-product-ec [product]=\"product\"></app-product-ec>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ProductEcComponent, selector: "app-product-ec", inputs: ["product", "isProductBox", "isCollection"], outputs: ["loaded"] }] });
|
|
5987
6137
|
}
|
|
5988
6138
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: BlockProductsEcComponent, decorators: [{
|
|
5989
6139
|
type: Component,
|
|
@@ -6351,6 +6501,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
6351
6501
|
args: ['mainCanvas', { static: true }]
|
|
6352
6502
|
}] } });
|
|
6353
6503
|
|
|
6504
|
+
// export * from './rating-ec/rating-ec.component';
|
|
6505
|
+
|
|
6354
6506
|
class BlockFormContactEcComponent extends BlockEcComponent {
|
|
6355
6507
|
block;
|
|
6356
6508
|
success_message;
|
|
@@ -7015,9 +7167,13 @@ class FiltersEcComponent {
|
|
|
7015
7167
|
_filtersService = inject(FiltersService);
|
|
7016
7168
|
filters = [];
|
|
7017
7169
|
filter$ = this._filtersService.filters$;
|
|
7170
|
+
setSelect;
|
|
7171
|
+
rangeMinRef;
|
|
7172
|
+
rangeMaxRef;
|
|
7173
|
+
priceGapPercentage = 0.1;
|
|
7018
7174
|
constructor() {
|
|
7019
7175
|
this.filter$.subscribe(res => {
|
|
7020
|
-
this.filters = this._filtersService.getSpecificFilters(['attributes', 'categories', 'dynamics']);
|
|
7176
|
+
this.filters = this._filtersService.getSpecificFilters(['attributes', 'categories', 'price_range', 'dynamics']);
|
|
7021
7177
|
});
|
|
7022
7178
|
}
|
|
7023
7179
|
getSpecificFilter(type) {
|
|
@@ -7038,13 +7194,114 @@ class FiltersEcComponent {
|
|
|
7038
7194
|
console.log("set", filter);
|
|
7039
7195
|
filter && this._filtersService.setFilterSelected(filter, selected);
|
|
7040
7196
|
}
|
|
7197
|
+
/**
|
|
7198
|
+
* Redondea al múltiplo de 'step' respetando el redondeo entero:
|
|
7199
|
+
* - Mínimo: redondea hacia abajo.
|
|
7200
|
+
* - Máximo: redondea hacia arriba.
|
|
7201
|
+
*/
|
|
7202
|
+
onRangeChange(event, type, filter) {
|
|
7203
|
+
const input = event.target;
|
|
7204
|
+
let value = parseInt(input.value, 10);
|
|
7205
|
+
value = this.roundToNearest(value, 5, type, filter);
|
|
7206
|
+
this.updateFilterPrices(type, value, filter, this.priceGapPercentage);
|
|
7207
|
+
}
|
|
7208
|
+
roundToNearest(value, step, type, filter) {
|
|
7209
|
+
let rounded = Math.round(value / step) * step;
|
|
7210
|
+
if (type === 'max' && rounded < filter.maxPrice) {
|
|
7211
|
+
rounded = Math.ceil(value / step) * step;
|
|
7212
|
+
}
|
|
7213
|
+
if (type === 'min' && rounded > filter.minPrice) {
|
|
7214
|
+
rounded = Math.floor(value / step) * step;
|
|
7215
|
+
}
|
|
7216
|
+
return rounded;
|
|
7217
|
+
}
|
|
7218
|
+
uniqueSelection(filter, filterChild) {
|
|
7219
|
+
// Buscar si hay un filtro de tipo PriceRangeFilter en la lista de filtros
|
|
7220
|
+
const priceRangeFilter = this.filters.find(f => f instanceof PriceRangeFilter);
|
|
7221
|
+
if (priceRangeFilter) {
|
|
7222
|
+
priceRangeFilter.reset();
|
|
7223
|
+
}
|
|
7224
|
+
filter.data.forEach(filterElement => {
|
|
7225
|
+
if (filterElement.selected) {
|
|
7226
|
+
filterElement.selected = false;
|
|
7227
|
+
}
|
|
7228
|
+
filterElement.children.forEach((filterChildren) => {
|
|
7229
|
+
if (filterChildren != filterChild && filterChildren.selected) {
|
|
7230
|
+
filterChildren.selected = false;
|
|
7231
|
+
}
|
|
7232
|
+
});
|
|
7233
|
+
});
|
|
7234
|
+
}
|
|
7235
|
+
/**
|
|
7236
|
+
* Actualiza los valores del filtro permitiendo que un input empuje al otro.
|
|
7237
|
+
*/
|
|
7238
|
+
updateFilterPrices(type, value, filter, priceGap) {
|
|
7239
|
+
const globalMin = filter.minPrice ?? 0;
|
|
7240
|
+
const globalMax = filter.maxPrice;
|
|
7241
|
+
let currentMin = filter.currentMinPrice ?? globalMin;
|
|
7242
|
+
let currentMax = filter.currentMaxPrice ?? globalMax;
|
|
7243
|
+
if (type === 'min') {
|
|
7244
|
+
let newMin = Math.min(Math.max(value, globalMin), globalMax);
|
|
7245
|
+
if (newMin + priceGap > currentMax) {
|
|
7246
|
+
let newMaxCandidate = newMin + priceGap;
|
|
7247
|
+
if (newMaxCandidate <= globalMax) {
|
|
7248
|
+
currentMax = newMaxCandidate;
|
|
7249
|
+
}
|
|
7250
|
+
else {
|
|
7251
|
+
newMin = globalMax - priceGap;
|
|
7252
|
+
}
|
|
7253
|
+
}
|
|
7254
|
+
filter.currentMinPrice = newMin;
|
|
7255
|
+
filter.currentMaxPrice = currentMax;
|
|
7256
|
+
}
|
|
7257
|
+
else if (type === 'max') {
|
|
7258
|
+
let newMax = Math.max(Math.min(value, globalMax), globalMin);
|
|
7259
|
+
if (newMax - priceGap < currentMin) {
|
|
7260
|
+
let newMinCandidate = newMax - priceGap;
|
|
7261
|
+
if (newMinCandidate >= globalMin) {
|
|
7262
|
+
currentMin = newMinCandidate;
|
|
7263
|
+
}
|
|
7264
|
+
else {
|
|
7265
|
+
newMax = globalMin + priceGap;
|
|
7266
|
+
}
|
|
7267
|
+
}
|
|
7268
|
+
filter.currentMaxPrice = newMax;
|
|
7269
|
+
filter.currentMinPrice = currentMin;
|
|
7270
|
+
}
|
|
7271
|
+
}
|
|
7272
|
+
// Método para actualizar los valores de precio seleccionados
|
|
7273
|
+
updatePriceRange(min, max, priceFilter) {
|
|
7274
|
+
priceFilter.setSelected(min, max);
|
|
7275
|
+
this.setSelect(priceFilter);
|
|
7276
|
+
}
|
|
7277
|
+
// Métodos para actualizar la barra del filtro por precio
|
|
7278
|
+
calculateLeftPercentage(currentMinPrice, minPrice, maxPrice) {
|
|
7279
|
+
const minVal = Math.max(minPrice, Math.min(currentMinPrice ?? minPrice, maxPrice));
|
|
7280
|
+
return Math.max(0, Math.min(((minVal - minPrice) / (maxPrice - minPrice)) * 100, 100));
|
|
7281
|
+
}
|
|
7282
|
+
calculateRightPercentage(currentMaxPrice, minPrice, maxPrice) {
|
|
7283
|
+
const maxVal = Math.max(minPrice, Math.min(currentMaxPrice ?? maxPrice, maxPrice));
|
|
7284
|
+
return Math.max(0, Math.min(100 - ((maxVal - minPrice) / (maxPrice - minPrice)) * 100, 100));
|
|
7285
|
+
}
|
|
7286
|
+
scrollUp = () => {
|
|
7287
|
+
window.scroll(0, 0);
|
|
7288
|
+
return true;
|
|
7289
|
+
};
|
|
7041
7290
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FiltersEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7042
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: FiltersEcComponent, isStandalone: true, selector: "lib-filters-ec", ngImport: i0, template: "<p>filters-ec works!</p>\r\n", styles: [""] });
|
|
7291
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: FiltersEcComponent, isStandalone: true, selector: "lib-filters-ec", inputs: { setSelect: "setSelect" }, viewQueries: [{ propertyName: "rangeMinRef", first: true, predicate: ["rangeMin"], descendants: true }, { propertyName: "rangeMaxRef", first: true, predicate: ["rangeMax"], descendants: true }], ngImport: i0, template: "<p>filters-ec works!</p>\r\n", styles: [""] });
|
|
7043
7292
|
}
|
|
7044
7293
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FiltersEcComponent, decorators: [{
|
|
7045
7294
|
type: Component,
|
|
7046
7295
|
args: [{ selector: 'lib-filters-ec', standalone: true, imports: [], template: "<p>filters-ec works!</p>\r\n" }]
|
|
7047
|
-
}], ctorParameters: () => []
|
|
7296
|
+
}], ctorParameters: () => [], propDecorators: { setSelect: [{
|
|
7297
|
+
type: Input
|
|
7298
|
+
}], rangeMinRef: [{
|
|
7299
|
+
type: ViewChild,
|
|
7300
|
+
args: ['rangeMin']
|
|
7301
|
+
}], rangeMaxRef: [{
|
|
7302
|
+
type: ViewChild,
|
|
7303
|
+
args: ['rangeMax']
|
|
7304
|
+
}] } });
|
|
7048
7305
|
|
|
7049
7306
|
class ProductDetailEcComponent {
|
|
7050
7307
|
_productDetailService = inject(ProductDetailService);
|
|
@@ -7053,6 +7310,8 @@ class ProductDetailEcComponent {
|
|
|
7053
7310
|
_domSanitizer = inject(DomSanitizer);
|
|
7054
7311
|
_consts = inject(CoreConstantsService);
|
|
7055
7312
|
_toastService = inject(ToastService);
|
|
7313
|
+
parametersService = inject(ParametersService);
|
|
7314
|
+
injector = inject(Injector);
|
|
7056
7315
|
_meta = inject(Meta);
|
|
7057
7316
|
_title = inject(Title);
|
|
7058
7317
|
_location = inject(Location);
|
|
@@ -7061,12 +7320,25 @@ class ProductDetailEcComponent {
|
|
|
7061
7320
|
data$ = this._productDetailService.associatedData$;
|
|
7062
7321
|
mediaUrl = this._consts.mediaUrl();
|
|
7063
7322
|
code = '';
|
|
7323
|
+
showFormContact = false;
|
|
7324
|
+
showReviews = false;
|
|
7325
|
+
reset = false;
|
|
7326
|
+
success = false;
|
|
7064
7327
|
quantity = signal(1);
|
|
7328
|
+
parameters$ = this.parametersService.getParameters();
|
|
7329
|
+
hasParams = this.parametersService.hasParams;
|
|
7065
7330
|
constructor() {
|
|
7066
7331
|
this._activedRoute.params.subscribe(queryParams => {
|
|
7067
7332
|
this.code = queryParams["id"];
|
|
7068
7333
|
this._productDetailService.loadProduct(this.code);
|
|
7069
7334
|
});
|
|
7335
|
+
this._activedRoute.params.subscribe(queryParams => {
|
|
7336
|
+
this.code = queryParams["id"];
|
|
7337
|
+
this._productDetailService.loadProduct(this.code);
|
|
7338
|
+
});
|
|
7339
|
+
this.injector.get(ChannelService).channel$.subscribe(channel => {
|
|
7340
|
+
this.showReviews = channel.showReviews;
|
|
7341
|
+
});
|
|
7070
7342
|
}
|
|
7071
7343
|
ngOnInit() {
|
|
7072
7344
|
this.product$.subscribe(product => {
|
|
@@ -7115,6 +7387,19 @@ class ProductDetailEcComponent {
|
|
|
7115
7387
|
if (this.quantity() >= stock)
|
|
7116
7388
|
this.quantity.set(stock);
|
|
7117
7389
|
}
|
|
7390
|
+
goToSection(section) {
|
|
7391
|
+
this.showFormContact = true;
|
|
7392
|
+
setTimeout(() => {
|
|
7393
|
+
const element = document.getElementById(section);
|
|
7394
|
+
if (element) {
|
|
7395
|
+
element.scrollIntoView({ behavior: 'smooth' });
|
|
7396
|
+
}
|
|
7397
|
+
}, 500);
|
|
7398
|
+
}
|
|
7399
|
+
resetForm = () => {
|
|
7400
|
+
this.reset = !this.reset;
|
|
7401
|
+
this.success = true;
|
|
7402
|
+
};
|
|
7118
7403
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ProductDetailEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7119
7404
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: ProductDetailEcComponent, isStandalone: true, selector: "app-product-detail-ec", ngImport: i0, template: "", styles: [""] });
|
|
7120
7405
|
}
|
|
@@ -7130,11 +7415,11 @@ class VariantsEcComponent {
|
|
|
7130
7415
|
this._productDetailsService.setOption(optionCode, optionValue);
|
|
7131
7416
|
}
|
|
7132
7417
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: VariantsEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7133
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: VariantsEcComponent, isStandalone: true, selector: "app-variants-ec", ngImport: i0, template: "@if(options$ | async; as options){\r\n
|
|
7418
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: VariantsEcComponent, isStandalone: true, selector: "app-variants-ec", ngImport: i0, template: "@if(options$ | async; as options){\r\n@if(options && options.length){\r\n@for(option of options; track $index){\r\n@switch (option.type) {\r\n@case ('color') {\r\n<h5>Colores disponibles</h5>\r\n<div class=\"row w-100 mx-auto pb-3 mb-3\">\r\n @for(value of option.values; track $index; let x = $index){\r\n <a role=\"button\" [title]=\"value.description\" (click)=\"setOption(option.code, value.name)\"\r\n [class]=\"'item m-1 circle ' + (value.selected ? 'shadow' : '')\" [id]=\"x + value.name\"\r\n [style.background]=\"'#' + value.name\" [style.box-shadow]=\"(value.selected ? '0px 0px 0px 2px #000' : 'none')\">\r\n </a>\r\n }\r\n</div>\r\n}\r\n@case ('size') {\r\n<h5>Talles displonibles</h5>\r\n<div class=\"row w-100 mx-auto pb-3\">\r\n @for(value of option.values; track $index; let x = $index){\r\n <a role=\"buttom\" (click)=\"setOption(option.code, value.name)\" [id]=\"x + value.name\"\r\n [class]=\"'btn item m-1 ' + (value.selected ? 'selected-size' : 'unselected-size')\">\r\n {{ value.name }}\r\n </a>\r\n }\r\n\r\n</div>\r\n}\r\n@default {\r\n\r\n}\r\n}\r\n}\r\n}\r\n}\r\n", styles: [".circle{width:32px;height:32px;border-radius:50%}.shadow{border:1px solid #000}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }] });
|
|
7134
7419
|
}
|
|
7135
7420
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: VariantsEcComponent, decorators: [{
|
|
7136
7421
|
type: Component,
|
|
7137
|
-
args: [{ selector: 'app-variants-ec', standalone: true, imports: [AsyncPipe], template: "@if(options$ | async; as options){\r\n
|
|
7422
|
+
args: [{ selector: 'app-variants-ec', standalone: true, imports: [AsyncPipe], template: "@if(options$ | async; as options){\r\n@if(options && options.length){\r\n@for(option of options; track $index){\r\n@switch (option.type) {\r\n@case ('color') {\r\n<h5>Colores disponibles</h5>\r\n<div class=\"row w-100 mx-auto pb-3 mb-3\">\r\n @for(value of option.values; track $index; let x = $index){\r\n <a role=\"button\" [title]=\"value.description\" (click)=\"setOption(option.code, value.name)\"\r\n [class]=\"'item m-1 circle ' + (value.selected ? 'shadow' : '')\" [id]=\"x + value.name\"\r\n [style.background]=\"'#' + value.name\" [style.box-shadow]=\"(value.selected ? '0px 0px 0px 2px #000' : 'none')\">\r\n </a>\r\n }\r\n</div>\r\n}\r\n@case ('size') {\r\n<h5>Talles displonibles</h5>\r\n<div class=\"row w-100 mx-auto pb-3\">\r\n @for(value of option.values; track $index; let x = $index){\r\n <a role=\"buttom\" (click)=\"setOption(option.code, value.name)\" [id]=\"x + value.name\"\r\n [class]=\"'btn item m-1 ' + (value.selected ? 'selected-size' : 'unselected-size')\">\r\n {{ value.name }}\r\n </a>\r\n }\r\n\r\n</div>\r\n}\r\n@default {\r\n\r\n}\r\n}\r\n}\r\n}\r\n}\r\n", styles: [".circle{width:32px;height:32px;border-radius:50%}.shadow{border:1px solid #000}\n"] }]
|
|
7138
7423
|
}] });
|
|
7139
7424
|
|
|
7140
7425
|
class BreadcrumbEcComponent {
|
|
@@ -7164,6 +7449,8 @@ class CartEcComponent {
|
|
|
7164
7449
|
totalPromotionAmount$ = this._cartService.getTotalPromotionAmount();
|
|
7165
7450
|
taxesAmount$ = this._cartService.getTaxesAmount();
|
|
7166
7451
|
totalAmount$ = this._cartService.getTotalAmount();
|
|
7452
|
+
_authService = inject(AuthService);
|
|
7453
|
+
isAuthenticated$ = this._authService.isAuthenticated();
|
|
7167
7454
|
removeCoupon() {
|
|
7168
7455
|
this._cartService.removeCoupon();
|
|
7169
7456
|
}
|
|
@@ -7177,13 +7464,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
7177
7464
|
|
|
7178
7465
|
class CartItemEcComponent {
|
|
7179
7466
|
item;
|
|
7467
|
+
inSidebar = false;
|
|
7180
7468
|
_cartService = inject(CartService);
|
|
7181
7469
|
_toastService = inject(ToastService);
|
|
7182
7470
|
_constants = inject(CoreConstantsService);
|
|
7183
7471
|
mediaUrl = this._constants.mediaUrl();
|
|
7184
7472
|
quantity = 0;
|
|
7473
|
+
variantsToShow = ['TALLE', 'COLOR'];
|
|
7474
|
+
updateStock = false;
|
|
7185
7475
|
ngOnInit() {
|
|
7186
7476
|
this.quantity = this.item.quantity;
|
|
7477
|
+
console.log(this.item, this.mediaUrl);
|
|
7187
7478
|
}
|
|
7188
7479
|
updateQuantity(stock) {
|
|
7189
7480
|
if (this.quantity > 0 && this.quantity <= stock) {
|
|
@@ -7205,17 +7496,82 @@ class CartItemEcComponent {
|
|
|
7205
7496
|
deleteCartItem() {
|
|
7206
7497
|
this._cartService.deleteCartItem(this.item);
|
|
7207
7498
|
}
|
|
7499
|
+
getVariants(product) {
|
|
7500
|
+
let item = product.product;
|
|
7501
|
+
if (item.variants && item.variants.length && item.variants[0].options && item.variants[0].options.length) {
|
|
7502
|
+
let options = item.variants[0].options;
|
|
7503
|
+
options = options.filter((option) => this.variantsToShow.find((name) => option.hasOwnProperty(name)));
|
|
7504
|
+
let optionsMap = [];
|
|
7505
|
+
options.map((option) => {
|
|
7506
|
+
Object.keys(option).forEach((entry) => {
|
|
7507
|
+
let optionAdded = false; // Variable para evitar múltiples inserciones
|
|
7508
|
+
item.options.forEach((option2) => {
|
|
7509
|
+
if (option2.code == 'COLOR') {
|
|
7510
|
+
option2.values.forEach((color) => {
|
|
7511
|
+
if (color.code == option[entry] && !optionAdded) {
|
|
7512
|
+
optionsMap.push({ name: entry, value: option[entry], image: color.image, mobileImage: color.mobileImage });
|
|
7513
|
+
optionAdded = true; // Marcar opción agregada
|
|
7514
|
+
}
|
|
7515
|
+
});
|
|
7516
|
+
}
|
|
7517
|
+
});
|
|
7518
|
+
// Si no se añadió la opción de COLOR, manejar otras opciones
|
|
7519
|
+
if (!optionAdded) {
|
|
7520
|
+
item.options.forEach((option2) => {
|
|
7521
|
+
if (option2.code !== 'COLOR') {
|
|
7522
|
+
optionsMap.push({
|
|
7523
|
+
name: entry,
|
|
7524
|
+
value: option[entry]
|
|
7525
|
+
});
|
|
7526
|
+
optionAdded = true;
|
|
7527
|
+
}
|
|
7528
|
+
});
|
|
7529
|
+
}
|
|
7530
|
+
});
|
|
7531
|
+
return optionsMap;
|
|
7532
|
+
});
|
|
7533
|
+
return optionsMap;
|
|
7534
|
+
}
|
|
7535
|
+
else {
|
|
7536
|
+
return null;
|
|
7537
|
+
}
|
|
7538
|
+
}
|
|
7539
|
+
createDiscountMessage(saleprice, price) {
|
|
7540
|
+
if (isNaN(saleprice) || isNaN(price) || saleprice >= price || saleprice <= 0 || price <= 0) {
|
|
7541
|
+
return '';
|
|
7542
|
+
}
|
|
7543
|
+
let discountPercentage = Math.round(((price - saleprice) / price) * 100);
|
|
7544
|
+
let discountMessage = `${discountPercentage}% OFF`;
|
|
7545
|
+
return discountMessage;
|
|
7546
|
+
}
|
|
7547
|
+
checkStock(product) {
|
|
7548
|
+
for (const variant of product.product.variants) {
|
|
7549
|
+
if (product.variant_id === variant.code) {
|
|
7550
|
+
if (variant.stock === 0) {
|
|
7551
|
+
this.updateStock = true;
|
|
7552
|
+
return '0';
|
|
7553
|
+
}
|
|
7554
|
+
else if (product.quantity > variant.stock) {
|
|
7555
|
+
this.updateStock = true;
|
|
7556
|
+
return variant.stock;
|
|
7557
|
+
}
|
|
7558
|
+
}
|
|
7559
|
+
}
|
|
7560
|
+
return false; // Solo se ejecuta si no se cumple la condición
|
|
7561
|
+
}
|
|
7208
7562
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CartItemEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7209
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
7563
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: CartItemEcComponent, isStandalone: true, selector: "app-cart-item-ec", inputs: { item: "item", inSidebar: "inSidebar" }, ngImport: i0, template: "@if(!inSidebar){\r\n<p>cart-item-ec works!</p>\r\n}@else{\r\n\r\n<div class=\"row\">\r\n <div class=\"col-2\">\r\n @let product= item.product;\r\n @if(item.variant_id && product.variants.length>0){\r\n <img [src]=\"mediaUrl + product.variants[0].images[0]\" alt=\"\" class=\"img-fluid\">\r\n }@else{\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"\" class=\"img-fluid\">\r\n }\r\n </div>\r\n <div class=\"col-8\">\r\n <div class=\"info d-flex flex-column align-items-start\">\r\n <a class=\"title text-dark text-decoration-none m-0 p-0 h6 mb-0\"\r\n [routerLink]=\"['/product', item.variant_id]\">{{\r\n item.product.name | titlecase\r\n }}</a>\r\n <div class=\"qty1\">\r\n <span>{{ item.product.id}}</span>\r\n </div>\r\n <div class=\"price h6 fw-bold mb-0 pb-0\">{{ item.product.price | ecCurrencySymbol\r\n }}</div>\r\n @if(getVariants(item); as options){\r\n <div class=\"d-flex align-items-center p-0\">\r\n @for(option of options; track $index){\r\n <span class=\"me-1\"> {{option.name | titlecase}}:</span>\r\n @if(option.name == 'COLOR'){\r\n <div class=\"p-2 rounded\" [style.background]=\"'#' + option.value\"></div>\r\n }@else{\r\n <b>{{option.value}}</b>\r\n }\r\n }\r\n </div>\r\n }\r\n <div class=\"input-group mb-3\">\r\n <button (click)=\"less(item.product.variants[0]?.stock)\" class=\"btn btn-outline-secondary\" type=\"button\" id=\"button-addon1\">\r\n <i class=\"fa fa-minus\" aria-hidden=\"true\"></i>\r\n </button>\r\n <input type=\"text\" class=\"form-control text-center\" placeholder=\"\" aria-label=\"Example text with button addon\"\r\n aria-describedby=\"button-addon1\" [value]=\"item.quantity\" min=\"1\" step=\"1\" [(ngModel)]=\"quantity\"\r\n (change)=\"updateQuantity(item.product.variants[0]?.stock)\">\r\n <button (click)=\"plus(item.product.variants[0]?.stock)\" class=\"btn btn-outline-secondary\" type=\"button\" id=\"button-addon1\">\r\n <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-2\">\r\n <a (click)=\"deleteCartItem()\" class=\"btn botBorrar\"><i class=\"fa fa-trash\" aria-hidden=\"true\"></i></a>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n}", styles: [""], dependencies: [{ kind: "pipe", type: TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: EcCurrencySymbolPipe, name: "ecCurrencySymbol" }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
|
|
7210
7564
|
}
|
|
7211
7565
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: CartItemEcComponent, decorators: [{
|
|
7212
7566
|
type: Component,
|
|
7213
|
-
args: [{ selector: '
|
|
7567
|
+
args: [{ selector: 'app-cart-item-ec', standalone: true, imports: [TitleCasePipe, EcCurrencySymbolPipe, RouterLink, FormsModule], template: "@if(!inSidebar){\r\n<p>cart-item-ec works!</p>\r\n}@else{\r\n\r\n<div class=\"row\">\r\n <div class=\"col-2\">\r\n @let product= item.product;\r\n @if(item.variant_id && product.variants.length>0){\r\n <img [src]=\"mediaUrl + product.variants[0].images[0]\" alt=\"\" class=\"img-fluid\">\r\n }@else{\r\n <img [src]=\"mediaUrl + product.picturesdefault[0]\" alt=\"\" class=\"img-fluid\">\r\n }\r\n </div>\r\n <div class=\"col-8\">\r\n <div class=\"info d-flex flex-column align-items-start\">\r\n <a class=\"title text-dark text-decoration-none m-0 p-0 h6 mb-0\"\r\n [routerLink]=\"['/product', item.variant_id]\">{{\r\n item.product.name | titlecase\r\n }}</a>\r\n <div class=\"qty1\">\r\n <span>{{ item.product.id}}</span>\r\n </div>\r\n <div class=\"price h6 fw-bold mb-0 pb-0\">{{ item.product.price | ecCurrencySymbol\r\n }}</div>\r\n @if(getVariants(item); as options){\r\n <div class=\"d-flex align-items-center p-0\">\r\n @for(option of options; track $index){\r\n <span class=\"me-1\"> {{option.name | titlecase}}:</span>\r\n @if(option.name == 'COLOR'){\r\n <div class=\"p-2 rounded\" [style.background]=\"'#' + option.value\"></div>\r\n }@else{\r\n <b>{{option.value}}</b>\r\n }\r\n }\r\n </div>\r\n }\r\n <div class=\"input-group mb-3\">\r\n <button (click)=\"less(item.product.variants[0]?.stock)\" class=\"btn btn-outline-secondary\" type=\"button\" id=\"button-addon1\">\r\n <i class=\"fa fa-minus\" aria-hidden=\"true\"></i>\r\n </button>\r\n <input type=\"text\" class=\"form-control text-center\" placeholder=\"\" aria-label=\"Example text with button addon\"\r\n aria-describedby=\"button-addon1\" [value]=\"item.quantity\" min=\"1\" step=\"1\" [(ngModel)]=\"quantity\"\r\n (change)=\"updateQuantity(item.product.variants[0]?.stock)\">\r\n <button (click)=\"plus(item.product.variants[0]?.stock)\" class=\"btn btn-outline-secondary\" type=\"button\" id=\"button-addon1\">\r\n <i class=\"fa fa-plus\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-2\">\r\n <a (click)=\"deleteCartItem()\" class=\"btn botBorrar\"><i class=\"fa fa-trash\" aria-hidden=\"true\"></i></a>\r\n </div>\r\n</div>\r\n\r\n\r\n\r\n\r\n\r\n}" }]
|
|
7214
7568
|
}], propDecorators: { item: [{
|
|
7215
7569
|
type: Input,
|
|
7216
7570
|
args: [{
|
|
7217
7571
|
required: true
|
|
7218
7572
|
}]
|
|
7573
|
+
}], inSidebar: [{
|
|
7574
|
+
type: Input
|
|
7219
7575
|
}] } });
|
|
7220
7576
|
|
|
7221
7577
|
class CouponEcComponent {
|
|
@@ -8126,8 +8482,8 @@ class OrdersListEcComponent {
|
|
|
8126
8482
|
}
|
|
8127
8483
|
toDate(date, format) { return moment(date).format(!format && 'DD/MM/YYYY, h:mm:ss a' || format); }
|
|
8128
8484
|
goToOrder(order) {
|
|
8129
|
-
|
|
8130
|
-
|
|
8485
|
+
this._ordersService.setSelectedOrder(order);
|
|
8486
|
+
this._router.navigateByUrl((`account/orders/${order.number}`));
|
|
8131
8487
|
}
|
|
8132
8488
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: OrdersListEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8133
8489
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: OrdersListEcComponent, isStandalone: true, selector: "app-orders-ec", ngImport: i0, template: "<div class=\"container-fluid\" id=\"ordersEcComponent\">\r\n @if(!loading){\r\n <section id=\"orders\" class=\"w-100\">\r\n @if(orders && orders.length){\r\n <div class=\"row mb-1 border-bottom\">\r\n <div class=\"col-lg-2 col-12\">\r\n <p [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'number' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\r\n (click)=\"sortOrders('number')\">{{ 'order' | translate }}:</p>\r\n </div>\r\n <div class=\"col-lg-2 col-12\">\r\n <p [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'paymentState' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\r\n (click)=\"sortOrders('paymentState')\">{{ 'payment-state' | translate }}:</p>\r\n </div>\r\n <div class=\"col-lg-2 col-12\">\r\n <p [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'method' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\r\n (click)=\"sortOrders('method')\">{{ 'shipment-method' | translate }}:</p>\r\n </div>\r\n <div class=\"col-lg-2 col-12 \">\r\n <p [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'methodState' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\r\n (click)=\"sortOrders('methodState')\">\r\n {{ 'shipment-state' | translate }}:</p>\r\n </div>\r\n <div class=\"col-lg-2 col-12\">\r\n <p [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'date' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\r\n (click)=\"sortOrders('date')\">{{ 'date' | translate }}:</p>\r\n </div>\r\n <div class=\"col-lg-2 col-12\">\r\n <p [class]=\"'st dropdown-toggle cursor-pointer my-2 '+ (currentSort.name == 'total' ? 'applied ' + (!currentSort.asc ? 'asc' : 'desc') : '')\"\r\n (click)=\"sortOrders('total')\">{{ 'total' | translate }}:</p>\r\n </div>\r\n </div>\r\n @for(order of orders; track $index){\r\n <div class=\"row item border-bottom py-2\">\r\n <div class=\"col-lg-2 col-12\">\r\n <h5 class=\"fw-bold\">\r\n {{ order.number }}\r\n </h5>\r\n </div>\r\n <div class=\"col-lg-2 col-12\">\r\n @if(order.payments && order.payments.length > 0){\r\n <p class=\"price\">\r\n {{ order.payments[0].state | translate | titlecase }}\r\n </p>\r\n }\r\n </div>\r\n <div class=\"col-lg-2 col-12\">\r\n <p class=\"price\">\r\n {{ order.shipments[0].method.name }}\r\n </p>\r\n </div>\r\n <div class=\"col-lg-2 col-12\">\r\n <p class=\"price\">\r\n {{ order.shipments[0].state | translate | titlecase }}\r\n </p>\r\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\r\n <!-- <button class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver seguimiento</button> -->\r\n @if(order.tracking){\r\n <a [href]=\"order.tracking\"\r\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver seguimiento</a>\r\n }\r\n </div>\r\n <div class=\"col-lg-2 col-12\">\r\n <p class=\"price\">\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-lg-2 col-12 d-flex\">\r\n @if(creditAmountConfigured ? showPrice : true){\r\n <h5 class=\"fw-bold text-nowrap\">\r\n {{ (order.totals.total) | ecCurrencySymbol }}\r\n </h5>\r\n }\r\n <!-- <button class=\"btn px-0 w-100 btdetalle\" (click)=\"goToOrder(order)\">{{\r\n 'see-order' | translate }}</button> -->\r\n <button class=\"btn px-0 w-100 btdetalle\" (click)=\"goToOrder(order)\">\r\n <i class=\"bi bi-box-arrow-in-right\"></i></button>\r\n </div>\r\n </div>\r\n }\r\n }@else {\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 }\r\n </section>\r\n }@else {\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 }\r\n</div>\r\n\r\n<ng-template #errorView>\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 <h4>{{ 'orders-error' | translate }}</h4>\r\n </div>\r\n </div>\r\n</ng-template>\r\n", styles: [""], dependencies: [{ kind: "component", type: LoadingFullEcComponent, selector: "app-loading-full-ec" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: EcCurrencySymbolPipe, name: "ecCurrencySymbol" }] });
|
|
@@ -8155,18 +8511,134 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
|
8155
8511
|
}] });
|
|
8156
8512
|
|
|
8157
8513
|
class OrderEcComponent {
|
|
8158
|
-
|
|
8514
|
+
_ordersService = inject(OrdersService);
|
|
8515
|
+
_consts = inject(ApiConstantsService);
|
|
8516
|
+
_constants = inject(CoreConstantsService);
|
|
8517
|
+
_router = inject(Router);
|
|
8518
|
+
_cartService = inject(CartService);
|
|
8519
|
+
_channelConfigService = inject(ChannelService);
|
|
8520
|
+
_activedRoute = inject(ActivatedRoute);
|
|
8521
|
+
order$ = this._ordersService.selectedOrder$;
|
|
8522
|
+
allowRepeatOrders = false;
|
|
8523
|
+
loading = false;
|
|
8524
|
+
showPrice = false;
|
|
8525
|
+
creditAmountConfigured = false;
|
|
8526
|
+
hidePrices = false;
|
|
8527
|
+
hideDiscounts = false;
|
|
8528
|
+
hideTaxes = false;
|
|
8529
|
+
channelConfig = this._ordersService.channelConfig;
|
|
8530
|
+
numberOrder;
|
|
8159
8531
|
ngOnInit() {
|
|
8160
|
-
|
|
8532
|
+
this.loading = true;
|
|
8533
|
+
this._ordersService.selectedOrder$.subscribe(res => {
|
|
8534
|
+
if (!res) {
|
|
8535
|
+
const number = this._activedRoute.snapshot.params["number"];
|
|
8536
|
+
this._ordersService.getOrderByNumber(number);
|
|
8537
|
+
}
|
|
8538
|
+
console.log('inside');
|
|
8539
|
+
});
|
|
8540
|
+
this._channelConfigService.channel$.subscribe((config) => {
|
|
8541
|
+
if (config && config.allowRepeatOrders !== undefined) {
|
|
8542
|
+
this.allowRepeatOrders = config.allowRepeatOrders;
|
|
8543
|
+
}
|
|
8544
|
+
else {
|
|
8545
|
+
this.allowRepeatOrders = false;
|
|
8546
|
+
}
|
|
8547
|
+
this.hidePrices = config?.hidePrices ?? false;
|
|
8548
|
+
this.hideDiscounts = config?.hideDiscounts ?? false;
|
|
8549
|
+
this.hideTaxes = config?.hideTaxes ?? false;
|
|
8550
|
+
});
|
|
8551
|
+
this._cartService.showPrice$.subscribe((showPrice) => {
|
|
8552
|
+
this.showPrice = showPrice;
|
|
8553
|
+
});
|
|
8554
|
+
this._cartService.creditAmount$.subscribe((creditAmount) => {
|
|
8555
|
+
this.creditAmountConfigured = creditAmount !== null;
|
|
8556
|
+
});
|
|
8557
|
+
}
|
|
8558
|
+
getUrlBase() {
|
|
8559
|
+
return this._consts.getUrlBase();
|
|
8161
8560
|
}
|
|
8561
|
+
back() {
|
|
8562
|
+
this._router.navigateByUrl('account/orders');
|
|
8563
|
+
}
|
|
8564
|
+
toDate(date, format) {
|
|
8565
|
+
return moment(date).format(!format && 'DD/MM/YYYY, h:mm:ss a' || format);
|
|
8566
|
+
}
|
|
8567
|
+
repeatOrder(order) {
|
|
8568
|
+
if (this.allowRepeatOrders && order) {
|
|
8569
|
+
//this._cartService.addRepeatOrderToCart(this.order.items);
|
|
8570
|
+
}
|
|
8571
|
+
}
|
|
8572
|
+
mediaUrl = () => this._constants.mediaUrl();
|
|
8162
8573
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: OrderEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8163
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: OrderEcComponent, isStandalone: true, selector: "app-order-ec", ngImport: i0, template: "<p>order-ec works!</p>\r\n", styles: [""] });
|
|
8574
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: OrderEcComponent, isStandalone: true, selector: "app-order-ec", ngImport: i0, template: "<main class=\"py-5\" id=\"orderEcComponent\">\r\n <div class=\"container\">\r\n @if(order$ | async; as order){\r\n <div class=\"wrap\">\r\n @if(order){\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 @if(order?.invoice){\r\n <div class=\"col-sm col-12 font-brandon\">\r\n <a target=\"_blank\" [href]=\"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 }\r\n <a (click)=\"back()\" class=\"col-auto text-end\">\r\n <button class=\"btn btn-outline-dark btvolver border\">{{ '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 @if(order.tracking){\r\n <a [href]=\"order.tracking\"\r\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">\r\n Ver seguimiento</a>\r\n }\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 @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'total' | translate }}:</p>\r\n <h5 class=\"fw-bold\">\r\n {{ (order.totals.total) | ecCurrencySymbol}}\r\n\r\n </h5>\r\n </div>\r\n }\r\n </div>\r\n </section>\r\n @if(!hidePrices && allowRepeatOrders){\r\n <div class=\"text-end mt-3\">\r\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder(order)\">\r\n {{ 'repeat-order' | translate }}\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"container py-3 border-top border-bottom\">\r\n @if(order.items.length){\r\n <div 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 @if(channelConfig.applyOrderLot){\r\n <div id=\"colLots\" 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 }\r\n @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\">\r\n {{ 'unit-price' | translate | uppercase }}\r\n </div>\r\n }\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 @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\">\r\n {{ 'total' | translate | uppercase }}\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n\r\n }\r\n @for(item of order.items; track $index; let i = $index){\r\n <div class=\"row cart-items\">\r\n <div class=\"col-5 col-md-2 py-2\">\r\n @if(item.product.variants[0]?.images?.length){\r\n <img class=\"smc maxwidth img-fluid rounded-custom \"\r\n [src]=\"mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\r\n } @else {\r\n @if(item.product.picturesdefault){\r\n <img class=\"smc maxwidth img-fluid rounded-custom\"\r\n [src]=\"mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\r\n }\r\n }\r\n </div>\r\n <div\r\n class=\"col-md-4 col-7 flex-column flex-md-row justify-content-start d-flex align-items-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 </div>\r\n @if(channelConfig.applyOrderLot){\r\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\">\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 }\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 @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-4 font-xl\">\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}}</p>\r\n </div>\r\n }\r\n @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-4 font-xl\">\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}}</p>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-2 d-none d-md-flex align-items-center\">\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}}\r\n </p>\r\n </div>\r\n }\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 @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-2 d-none d-md-flex align-items-center\">\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}}</p>\r\n </div>\r\n }\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 @for( lot of item.orderItemLot; track $index){\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 @if(lot.date_deliver){\r\n <td>{{\r\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\r\n } @else {\r\n <td>Pendiente</td>\r\n }\r\n <td>{{lot.shipping_address_name}}</td>\r\n <td>{{lot.notes}}</td>\r\n <td>{{lot.total_lot | ecCurrencySymbol}}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n }\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 @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-12 col-md-6\">\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.items) | ecCurrencySymbol }}\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 }}\r\n\r\n </div>\r\n @if(!hideDiscounts && order.totals.promotion && order.totals.promotion != 0){\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\r\n translate }}</div>\r\n }\r\n @if(!hideDiscounts && order.totals.promotion && order.totals.promotion != 0){\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\r\n {{ (order.totals.promotion) | ecCurrencySymbol }}</div>\r\n }\r\n @if(!hideTaxes && order.totals.taxes && order.totals.taxes != 0 ){\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'taxes' | translate }}</div>\r\n }\r\n @if(!hideTaxes && order.totals.taxes && order.totals.taxes != 0){\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.taxes) | ecCurrencySymbol }}</div>\r\n }\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 }}\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n } @else {\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 }\r\n </div>\r\n\r\n } @else {\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 }\r\n </div>\r\n</main>", styles: [""], dependencies: [{ kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$1.TranslatePipe, name: "translate" }, { kind: "pipe", type: EcCurrencySymbolPipe, name: "ecCurrencySymbol" }, { kind: "component", type: LoadingFullEcComponent, selector: "app-loading-full-ec" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: UpperCasePipe, name: "uppercase" }] });
|
|
8164
8575
|
}
|
|
8165
8576
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: OrderEcComponent, decorators: [{
|
|
8166
8577
|
type: Component,
|
|
8167
|
-
args: [{ selector: 'app-order-ec', standalone: true, imports: [
|
|
8578
|
+
args: [{ selector: 'app-order-ec', standalone: true, imports: [TranslateModule,
|
|
8579
|
+
EcCurrencySymbolPipe,
|
|
8580
|
+
LoadingFullEcComponent,
|
|
8581
|
+
AsyncPipe,
|
|
8582
|
+
TitleCasePipe,
|
|
8583
|
+
UpperCasePipe
|
|
8584
|
+
], template: "<main class=\"py-5\" id=\"orderEcComponent\">\r\n <div class=\"container\">\r\n @if(order$ | async; as order){\r\n <div class=\"wrap\">\r\n @if(order){\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 @if(order?.invoice){\r\n <div class=\"col-sm col-12 font-brandon\">\r\n <a target=\"_blank\" [href]=\"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 }\r\n <a (click)=\"back()\" class=\"col-auto text-end\">\r\n <button class=\"btn btn-outline-dark btvolver border\">{{ '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 @if(order.tracking){\r\n <a [href]=\"order.tracking\"\r\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">\r\n Ver seguimiento</a>\r\n }\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 @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'total' | translate }}:</p>\r\n <h5 class=\"fw-bold\">\r\n {{ (order.totals.total) | ecCurrencySymbol}}\r\n\r\n </h5>\r\n </div>\r\n }\r\n </div>\r\n </section>\r\n @if(!hidePrices && allowRepeatOrders){\r\n <div class=\"text-end mt-3\">\r\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder(order)\">\r\n {{ 'repeat-order' | translate }}\r\n </button>\r\n </div>\r\n }\r\n\r\n <div class=\"container py-3 border-top border-bottom\">\r\n @if(order.items.length){\r\n <div 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 @if(channelConfig.applyOrderLot){\r\n <div id=\"colLots\" 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 }\r\n @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\">\r\n {{ 'unit-price' | translate | uppercase }}\r\n </div>\r\n }\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 @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\">\r\n {{ 'total' | translate | uppercase }}\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n\r\n }\r\n @for(item of order.items; track $index; let i = $index){\r\n <div class=\"row cart-items\">\r\n <div class=\"col-5 col-md-2 py-2\">\r\n @if(item.product.variants[0]?.images?.length){\r\n <img class=\"smc maxwidth img-fluid rounded-custom \"\r\n [src]=\"mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\r\n } @else {\r\n @if(item.product.picturesdefault){\r\n <img class=\"smc maxwidth img-fluid rounded-custom\"\r\n [src]=\"mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\r\n }\r\n }\r\n </div>\r\n <div\r\n class=\"col-md-4 col-7 flex-column flex-md-row justify-content-start d-flex align-items-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 </div>\r\n @if(channelConfig.applyOrderLot){\r\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\">\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 }\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 @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-4 font-xl\">\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}}</p>\r\n </div>\r\n }\r\n @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-4 font-xl\">\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}}</p>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-2 d-none d-md-flex align-items-center\">\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}}\r\n </p>\r\n </div>\r\n }\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 @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-2 d-none d-md-flex align-items-center\">\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}}</p>\r\n </div>\r\n }\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 @for( lot of item.orderItemLot; track $index){\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 @if(lot.date_deliver){\r\n <td>{{\r\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\r\n } @else {\r\n <td>Pendiente</td>\r\n }\r\n <td>{{lot.shipping_address_name}}</td>\r\n <td>{{lot.notes}}</td>\r\n <td>{{lot.total_lot | ecCurrencySymbol}}</td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n }\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 @if(creditAmountConfigured ? showPrice : true){\r\n <div class=\"col-12 col-md-6\">\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.items) | ecCurrencySymbol }}\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 }}\r\n\r\n </div>\r\n @if(!hideDiscounts && order.totals.promotion && order.totals.promotion != 0){\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\r\n translate }}</div>\r\n }\r\n @if(!hideDiscounts && order.totals.promotion && order.totals.promotion != 0){\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\r\n {{ (order.totals.promotion) | ecCurrencySymbol }}</div>\r\n }\r\n @if(!hideTaxes && order.totals.taxes && order.totals.taxes != 0 ){\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'taxes' | translate }}</div>\r\n }\r\n @if(!hideTaxes && order.totals.taxes && order.totals.taxes != 0){\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.taxes) | ecCurrencySymbol }}</div>\r\n }\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 }}\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n } @else {\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 }\r\n </div>\r\n\r\n } @else {\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 }\r\n </div>\r\n</main>" }]
|
|
8168
8585
|
}] });
|
|
8169
8586
|
|
|
8587
|
+
class SidebarEcComponent {
|
|
8588
|
+
_cartService = inject(CartService);
|
|
8589
|
+
_consts = inject(CoreConstantsService);
|
|
8590
|
+
_authService = inject(AuthService);
|
|
8591
|
+
_router = inject(Router);
|
|
8592
|
+
_toastrService = inject(ToastService);
|
|
8593
|
+
_channelService = inject(ChannelService);
|
|
8594
|
+
user = null;
|
|
8595
|
+
mediaUrl = this._consts.mediaUrl();
|
|
8596
|
+
promotions = [];
|
|
8597
|
+
variantsToShow = ['TALLE', 'COLOR'];
|
|
8598
|
+
hideDiscounts = false;
|
|
8599
|
+
hideTaxes = false;
|
|
8600
|
+
cartItems$ = this._cartService.cartItems$;
|
|
8601
|
+
subTotalAmount$ = this._cartService.getSubTotalAmount();
|
|
8602
|
+
totalPromotionAmount$ = this._cartService.getTotalPromotionAmount();
|
|
8603
|
+
taxesAmount$ = this._cartService.getTaxesAmount();
|
|
8604
|
+
totalAmount$ = this._cartService.getTotalAmount();
|
|
8605
|
+
ngOnInit() {
|
|
8606
|
+
this._cartService.promotions$.subscribe(promotions => this.promotions = promotions);
|
|
8607
|
+
this._authService.getUserProfile().subscribe(u => {
|
|
8608
|
+
this.user = u;
|
|
8609
|
+
});
|
|
8610
|
+
this._channelService.channel$.subscribe(channel => {
|
|
8611
|
+
this.hideDiscounts = channel?.hideDiscounts ?? false;
|
|
8612
|
+
this.hideTaxes = channel?.hideTaxes ?? false;
|
|
8613
|
+
});
|
|
8614
|
+
}
|
|
8615
|
+
actualizarCantidad(_t13, arg1, arg2, arg3, arg4) {
|
|
8616
|
+
throw new Error('Method not implemented.');
|
|
8617
|
+
}
|
|
8618
|
+
getVariants(_t8) {
|
|
8619
|
+
throw new Error('Method not implemented.');
|
|
8620
|
+
}
|
|
8621
|
+
getTotalAmount() {
|
|
8622
|
+
throw new Error('Method not implemented.');
|
|
8623
|
+
}
|
|
8624
|
+
removeCoupon() {
|
|
8625
|
+
throw new Error('Method not implemented.');
|
|
8626
|
+
}
|
|
8627
|
+
deleteCartItem(_t8, arg1) {
|
|
8628
|
+
throw new Error('Method not implemented.');
|
|
8629
|
+
}
|
|
8630
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SidebarEcComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
8631
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: SidebarEcComponent, isStandalone: true, selector: "app-sidebar-ec", ngImport: i0, template: "<div class=\"nav my-4 mx-0 position-relative text-center shadow-sm border-bottom d-flex justify-content-center\">\r\n <h2 class=\"row text-center\">Mi carrito</h2>\r\n <div class=\" me-3 closeCart position-absolute end-0\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\">\r\n <i class=\"fa fa-times-circle fs-5\" aria-hidden=\"true\"></i>\r\n </div>\r\n</div>\r\n\r\n\r\n@if(cartItems$ | async; as items){\r\n @if(items.length > 0){\r\n <!-- PRODUCTO -->\r\n <div class=\"d-flex flex-column mb-4 items\">\r\n @for(item of items; track $index; let i = $index){\r\n <div class=\"productoCarrito mt-1 mb-2 w-100\">\r\n <app-cart-item-ec [inSidebar]=\"true\" [item]=\"item\"></app-cart-item-ec>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between border-top \">\r\n <p>Subtotal</p>\r\n <p class=\"fw-700\">{{ (subTotalAmount$ | async) | ecCurrencySymbol}}</p>\r\n </div>\r\n <div class=\"mx-4 bordeBot\">\r\n <app-coupon-ec></app-coupon-ec>\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between bordeBot2\">\r\n <p>Descuentos:</p>\r\n <p>{{ (totalPromotionAmount$ | async) |ecCurrencySymbol }}</p>\r\n </div>\r\n\r\n <div class=\"d-flex mx-4 justify-content-between bordeBot2\">\r\n <!-- @if(this._cartService.cart.source.value.couponCode){\r\n <a class=\"quitar-cupon text-dark\" role=\"button\"\r\n (click)=\"removeCoupon()\">(Quitar cup\u00F3n)</a>\r\n } -->\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between mb-3 mt-2\">\r\n <p class=\"fw-bold h5\">TOTAL</p>\r\n <p class=\"fw-bold h5\">{{(totalAmount$ | async) | ecCurrencySymbol}}</p>\r\n </div>\r\n <div class=\"d-flex flex-column mx-4 justify-content-between mb-3\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\">\r\n <a [routerLink]=\"['/cart']\" class=\"btn btn-primary btn-block w-100 btnComprar mb-2 mt-3 \">CONFIRMAR PEDIDO</a>\r\n <a [routerLink]=\"['/collection']\" class=\"btn btn-secondary btn-block w-100 btnSeguir\">SEGUIR COMPRANDO</a>\r\n </div>\r\n\r\n\r\n } @else {\r\n <div class=\"container-lg px-lg-0 px-md-4 my-5\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <h5 class=\"text-center mb-sm-4 text-uppercase\"> \u00B7 Su carrito se\r\n encuentra vac\u00EDo \u00B7 </h5>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n}", styles: [".items{max-height:35vh;overflow-y:scroll;overflow-x:hidden}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: CouponEcComponent, selector: "app-coupon-ec" }, { kind: "component", type: CartItemEcComponent, selector: "app-cart-item-ec", inputs: ["item", "inSidebar"] }, { kind: "pipe", type: EcCurrencySymbolPipe, name: "ecCurrencySymbol" }] });
|
|
8632
|
+
}
|
|
8633
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SidebarEcComponent, decorators: [{
|
|
8634
|
+
type: Component,
|
|
8635
|
+
args: [{ selector: 'app-sidebar-ec', standalone: true, imports: [RouterLink, AsyncPipe, CouponEcComponent, CartItemEcComponent, EcCurrencySymbolPipe], template: "<div class=\"nav my-4 mx-0 position-relative text-center shadow-sm border-bottom d-flex justify-content-center\">\r\n <h2 class=\"row text-center\">Mi carrito</h2>\r\n <div class=\" me-3 closeCart position-absolute end-0\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\">\r\n <i class=\"fa fa-times-circle fs-5\" aria-hidden=\"true\"></i>\r\n </div>\r\n</div>\r\n\r\n\r\n@if(cartItems$ | async; as items){\r\n @if(items.length > 0){\r\n <!-- PRODUCTO -->\r\n <div class=\"d-flex flex-column mb-4 items\">\r\n @for(item of items; track $index; let i = $index){\r\n <div class=\"productoCarrito mt-1 mb-2 w-100\">\r\n <app-cart-item-ec [inSidebar]=\"true\" [item]=\"item\"></app-cart-item-ec>\r\n </div>\r\n }\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between border-top \">\r\n <p>Subtotal</p>\r\n <p class=\"fw-700\">{{ (subTotalAmount$ | async) | ecCurrencySymbol}}</p>\r\n </div>\r\n <div class=\"mx-4 bordeBot\">\r\n <app-coupon-ec></app-coupon-ec>\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between bordeBot2\">\r\n <p>Descuentos:</p>\r\n <p>{{ (totalPromotionAmount$ | async) |ecCurrencySymbol }}</p>\r\n </div>\r\n\r\n <div class=\"d-flex mx-4 justify-content-between bordeBot2\">\r\n <!-- @if(this._cartService.cart.source.value.couponCode){\r\n <a class=\"quitar-cupon text-dark\" role=\"button\"\r\n (click)=\"removeCoupon()\">(Quitar cup\u00F3n)</a>\r\n } -->\r\n </div>\r\n <div class=\"d-flex mx-4 justify-content-between mb-3 mt-2\">\r\n <p class=\"fw-bold h5\">TOTAL</p>\r\n <p class=\"fw-bold h5\">{{(totalAmount$ | async) | ecCurrencySymbol}}</p>\r\n </div>\r\n <div class=\"d-flex flex-column mx-4 justify-content-between mb-3\" data-bs-dismiss=\"offcanvas\" aria-label=\"Close\">\r\n <a [routerLink]=\"['/cart']\" class=\"btn btn-primary btn-block w-100 btnComprar mb-2 mt-3 \">CONFIRMAR PEDIDO</a>\r\n <a [routerLink]=\"['/collection']\" class=\"btn btn-secondary btn-block w-100 btnSeguir\">SEGUIR COMPRANDO</a>\r\n </div>\r\n\r\n\r\n } @else {\r\n <div class=\"container-lg px-lg-0 px-md-4 my-5\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <h5 class=\"text-center mb-sm-4 text-uppercase\"> \u00B7 Su carrito se\r\n encuentra vac\u00EDo \u00B7 </h5>\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n}", styles: [".items{max-height:35vh;overflow-y:scroll;overflow-x:hidden}\n"] }]
|
|
8636
|
+
}] });
|
|
8637
|
+
|
|
8638
|
+
// export * from './related-products-ec/related-products-ec.component';
|
|
8639
|
+
// export * from './reviews-form-ec/reviews-form-ec.component';
|
|
8640
|
+
// export * from './reviews-ec/reviews-ec.component';
|
|
8641
|
+
|
|
8170
8642
|
//Types
|
|
8171
8643
|
|
|
8172
8644
|
/**
|
|
@@ -8215,6 +8687,198 @@ const authInterceptor = (req, next) => {
|
|
|
8215
8687
|
return next(req);
|
|
8216
8688
|
};
|
|
8217
8689
|
|
|
8690
|
+
class ProductStockDirective {
|
|
8691
|
+
templateRef;
|
|
8692
|
+
viewContainer;
|
|
8693
|
+
productDirective = null;
|
|
8694
|
+
ecProductStockElse;
|
|
8695
|
+
set ecProductStock(product) {
|
|
8696
|
+
this.productDirective = product;
|
|
8697
|
+
this.viewContainer.clear();
|
|
8698
|
+
if (this.validateStock()) {
|
|
8699
|
+
if (this.ecProductStockElse) {
|
|
8700
|
+
this.viewContainer.createEmbeddedView(this.ecProductStockElse);
|
|
8701
|
+
}
|
|
8702
|
+
else {
|
|
8703
|
+
console.error('falta definir el template de agotado');
|
|
8704
|
+
}
|
|
8705
|
+
}
|
|
8706
|
+
else {
|
|
8707
|
+
this.viewContainer.createEmbeddedView(this.templateRef);
|
|
8708
|
+
}
|
|
8709
|
+
}
|
|
8710
|
+
constructor(templateRef, viewContainer) {
|
|
8711
|
+
this.templateRef = templateRef;
|
|
8712
|
+
this.viewContainer = viewContainer;
|
|
8713
|
+
}
|
|
8714
|
+
ngOnInit() { }
|
|
8715
|
+
ngOnDestroy() { }
|
|
8716
|
+
ngOnChanges() { }
|
|
8717
|
+
validateStock = () => {
|
|
8718
|
+
if (!this.productDirective || this.productDirective.special_mark == undefined || this.productDirective.variants == undefined) {
|
|
8719
|
+
setTimeout(() => {
|
|
8720
|
+
this.validateStock();
|
|
8721
|
+
}, 1000);
|
|
8722
|
+
return false; // Ensure a boolean is returned
|
|
8723
|
+
}
|
|
8724
|
+
else {
|
|
8725
|
+
return this.checkValuesForStock();
|
|
8726
|
+
}
|
|
8727
|
+
};
|
|
8728
|
+
checkValuesForStock = () => {
|
|
8729
|
+
let existMark = false;
|
|
8730
|
+
// Check special_mark
|
|
8731
|
+
if (this.productDirective?.special_mark) {
|
|
8732
|
+
this.productDirective.special_mark.forEach(special_mark => {
|
|
8733
|
+
if (special_mark.type === 'out_of_stock') {
|
|
8734
|
+
existMark = true;
|
|
8735
|
+
}
|
|
8736
|
+
});
|
|
8737
|
+
}
|
|
8738
|
+
// Check variants
|
|
8739
|
+
if (!existMark && this.productDirective) {
|
|
8740
|
+
existMark = !!(this.productDirective.variant_id
|
|
8741
|
+
? this.productDirective.variants?.find(v => v.code === this.productDirective?.variant_id && v.stock > 0) === undefined
|
|
8742
|
+
: this.productDirective.variants?.find(v => v.stock > 0) === undefined);
|
|
8743
|
+
}
|
|
8744
|
+
return existMark;
|
|
8745
|
+
};
|
|
8746
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ProductStockDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
8747
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: ProductStockDirective, selector: "[ecProductStock]", inputs: { ecProductStockElse: "ecProductStockElse", ecProductStock: "ecProductStock" }, usesOnChanges: true, ngImport: i0 });
|
|
8748
|
+
}
|
|
8749
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ProductStockDirective, decorators: [{
|
|
8750
|
+
type: Directive,
|
|
8751
|
+
args: [{
|
|
8752
|
+
selector: "[ecProductStock]"
|
|
8753
|
+
}]
|
|
8754
|
+
}], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }], propDecorators: { ecProductStockElse: [{
|
|
8755
|
+
type: Input
|
|
8756
|
+
}], ecProductStock: [{
|
|
8757
|
+
type: Input
|
|
8758
|
+
}] } });
|
|
8759
|
+
|
|
8760
|
+
class ParamsContext {
|
|
8761
|
+
}
|
|
8762
|
+
class ProductOffDirective {
|
|
8763
|
+
document;
|
|
8764
|
+
elementRef;
|
|
8765
|
+
renderer;
|
|
8766
|
+
product;
|
|
8767
|
+
classStr = "";
|
|
8768
|
+
customMessageStr = "{discount}% OFF";
|
|
8769
|
+
set ecProductOff(value) {
|
|
8770
|
+
this.product = value;
|
|
8771
|
+
}
|
|
8772
|
+
set classStrSpacing(value) {
|
|
8773
|
+
this.classStr = value;
|
|
8774
|
+
}
|
|
8775
|
+
set customMessage(value) {
|
|
8776
|
+
this.customMessageStr = value;
|
|
8777
|
+
}
|
|
8778
|
+
constructor(document, elementRef, renderer) {
|
|
8779
|
+
this.document = document;
|
|
8780
|
+
this.elementRef = elementRef;
|
|
8781
|
+
this.renderer = renderer;
|
|
8782
|
+
}
|
|
8783
|
+
ngOnInit() { }
|
|
8784
|
+
hasDiscount = (product) => {
|
|
8785
|
+
if (!product.saleprice) {
|
|
8786
|
+
return null;
|
|
8787
|
+
}
|
|
8788
|
+
if (typeof product.price === 'string' && product.price.includes("-") &&
|
|
8789
|
+
typeof product.saleprice === 'string' && product.saleprice.includes("-")) {
|
|
8790
|
+
let prices = product.price.split('-');
|
|
8791
|
+
let saleprices = product.saleprice.split('-');
|
|
8792
|
+
let saleBf = this.generateDiscount(prices[1]?.trim(), saleprices[1]?.trim());
|
|
8793
|
+
let saleLt = this.generateDiscount(prices[0]?.trim(), saleprices[0]?.trim());
|
|
8794
|
+
if (!saleBf && !saleLt) {
|
|
8795
|
+
return null;
|
|
8796
|
+
}
|
|
8797
|
+
if (saleBf && saleLt && saleBf === saleLt) {
|
|
8798
|
+
return `${saleBf}`;
|
|
8799
|
+
}
|
|
8800
|
+
if (saleBf && !saleLt) {
|
|
8801
|
+
return `${saleBf}`;
|
|
8802
|
+
}
|
|
8803
|
+
if (!saleBf && saleLt) {
|
|
8804
|
+
return `${saleLt}`;
|
|
8805
|
+
}
|
|
8806
|
+
return `${saleBf} - ${saleLt}`;
|
|
8807
|
+
}
|
|
8808
|
+
else {
|
|
8809
|
+
if (parseInt(product.price) > parseInt(product.saleprice)) {
|
|
8810
|
+
return this.generateDiscount(product.price, product.saleprice)?.toString() || null;
|
|
8811
|
+
}
|
|
8812
|
+
}
|
|
8813
|
+
return null; // Ensure a return value in all code paths
|
|
8814
|
+
};
|
|
8815
|
+
generateDiscount = (price, saleprice) => {
|
|
8816
|
+
if (parseFloat(price) > parseFloat(saleprice)) {
|
|
8817
|
+
let result = ((parseFloat(price) - parseFloat(saleprice)) /
|
|
8818
|
+
parseFloat(price)) *
|
|
8819
|
+
100;
|
|
8820
|
+
if (Number.isNaN(result)) {
|
|
8821
|
+
return null;
|
|
8822
|
+
}
|
|
8823
|
+
else
|
|
8824
|
+
return Math.round(result); //Math.floor(result);
|
|
8825
|
+
}
|
|
8826
|
+
return null;
|
|
8827
|
+
};
|
|
8828
|
+
ngOnChanges(changes) {
|
|
8829
|
+
if (this.product.price) {
|
|
8830
|
+
let discount = this.hasDiscount(this.product);
|
|
8831
|
+
this.elementRef.nativeElement.childNodes.forEach((node) => {
|
|
8832
|
+
this.renderer.removeChild(this.elementRef.nativeElement, node);
|
|
8833
|
+
});
|
|
8834
|
+
if (discount) {
|
|
8835
|
+
this.renderer.appendChild(this.elementRef.nativeElement, this.createImage(discount));
|
|
8836
|
+
}
|
|
8837
|
+
// else {
|
|
8838
|
+
// this.renderer.removeChild(this.elementRef.nativeElement.parentElement, this.elementRef.nativeElement);
|
|
8839
|
+
// }
|
|
8840
|
+
}
|
|
8841
|
+
}
|
|
8842
|
+
createImage = (discount) => {
|
|
8843
|
+
let popover = this.renderer.createElement("a");
|
|
8844
|
+
this.customMessageStr = this.customMessageStr.replace('{discount}', discount);
|
|
8845
|
+
this.renderer.setProperty(popover, "innerHTML", this.customMessageStr);
|
|
8846
|
+
this.classStr?.split(" ").forEach((cl) => {
|
|
8847
|
+
try {
|
|
8848
|
+
this.renderer.addClass(popover, cl);
|
|
8849
|
+
}
|
|
8850
|
+
catch (error) {
|
|
8851
|
+
console.log('add class directive -> ', error);
|
|
8852
|
+
}
|
|
8853
|
+
});
|
|
8854
|
+
return popover;
|
|
8855
|
+
};
|
|
8856
|
+
ngOnDestroy() { }
|
|
8857
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ProductOffDirective, deps: [{ token: DOCUMENT }, { token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
8858
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: ProductOffDirective, selector: "[ecProductOff]", inputs: { ecProductOff: "ecProductOff", classStrSpacing: "classStrSpacing", customMessage: "customMessage" }, usesOnChanges: true, ngImport: i0 });
|
|
8859
|
+
}
|
|
8860
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ProductOffDirective, decorators: [{
|
|
8861
|
+
type: Directive,
|
|
8862
|
+
args: [{
|
|
8863
|
+
selector: "[ecProductOff]",
|
|
8864
|
+
}]
|
|
8865
|
+
}], ctorParameters: () => [{ type: Document, decorators: [{
|
|
8866
|
+
type: Inject,
|
|
8867
|
+
args: [DOCUMENT]
|
|
8868
|
+
}] }, { type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { ecProductOff: [{
|
|
8869
|
+
type: Input
|
|
8870
|
+
}], classStrSpacing: [{
|
|
8871
|
+
type: Input
|
|
8872
|
+
}], customMessage: [{
|
|
8873
|
+
type: Input
|
|
8874
|
+
}] } });
|
|
8875
|
+
|
|
8876
|
+
//Directives base
|
|
8877
|
+
const directives = [
|
|
8878
|
+
ProductOffDirective,
|
|
8879
|
+
ProductStockDirective,
|
|
8880
|
+
];
|
|
8881
|
+
|
|
8218
8882
|
/*
|
|
8219
8883
|
* Public API Surface of ng-easycommerce
|
|
8220
8884
|
*/
|
|
@@ -8224,5 +8888,5 @@ const authInterceptor = (req, next) => {
|
|
|
8224
8888
|
* Generated bundle index. Do not edit.
|
|
8225
8889
|
*/
|
|
8226
8890
|
|
|
8227
|
-
export { AccountEcComponent, AddressingService, AnalyticsService, AuthEcComponent, AuthService, AuthStorageService, BlockBannerBoxEcComponent, BlockBannerFullEcComponent, BlockFormContactEcComponent, BlockHtmlEcComponent, BlockNewsletterEcComponent, BlockProductsEcComponent, BlocksEcComponent, BlocksRepositoryService, BlocksService, BreadcrumbEcComponent, CartEcComponent, CartItemEcComponent, CartService, ChannelService, CheckoutEcComponent, CheckoutService, CollectionEcComponent, ConfirmAccountEcComponent, CoreConstantsService, CouponEcComponent, CurrencyService, DopplerService, ENVIRONMENT_TOKEN, EcCurrencySymbolPipe, FacebookPixelService, FiltersEcComponent, FiltersService, FiltersSortEcComponent, FooterEcComponent, ForgotPasswordEcComponent, FormService, GTMService, GoogleAnalyticsService, HeaderEcComponent, HomeEcComponent, LoadingFullEcComponent, LoadingInlineEcComponent, LoadingSectionEcComponent, LocalStorageService, LoginFormEcComponent, MagnizoomEcComponent, MetricoolPixelService, NgxLocalStorageService, OptionsService, OrderEcComponent, OrderUtilityService, OrdersListEcComponent, OrdersService, PaginationService, ParametersService, PaymentService, PriceEcComponent, ProductDetailEcComponent, ProductDetailService, ProductEcComponent, ProductsService, ReCaptchaEcComponent, ReCaptchaService, RegisterFormEcComponent, RegisterWholesalerFormEcComponent, ShipmentService, SuccessEcComponent, TestService, ToastService, VariantsEcComponent, authGuard, authInterceptor, provideEnvironment };
|
|
8891
|
+
export { AccountEcComponent, AddressingService, AnalyticsService, AuthEcComponent, AuthService, AuthStorageService, BlockBannerBoxEcComponent, BlockBannerFullEcComponent, BlockFormContactEcComponent, BlockHtmlEcComponent, BlockNewsletterEcComponent, BlockProductsEcComponent, BlocksEcComponent, BlocksRepositoryService, BlocksService, BreadcrumbEcComponent, CartEcComponent, CartItemEcComponent, CartService, ChannelService, CheckoutEcComponent, CheckoutService, CollectionEcComponent, ConfirmAccountEcComponent, CoreConstantsService, CouponEcComponent, CurrencyService, DopplerService, ENVIRONMENT_TOKEN, EcCurrencySymbolPipe, FacebookPixelService, FiltersEcComponent, FiltersService, FiltersSortEcComponent, FooterEcComponent, ForgotPasswordEcComponent, FormService, GTMService, GoogleAnalyticsService, HeaderEcComponent, HomeEcComponent, LoadingFullEcComponent, LoadingInlineEcComponent, LoadingSectionEcComponent, LocalStorageService, LoginFormEcComponent, MagnizoomEcComponent, MetricoolPixelService, NgxLocalStorageService, OptionsService, OrderEcComponent, OrderUtilityService, OrdersListEcComponent, OrdersService, PaginationService, ParametersService, ParamsContext, PaymentService, PriceEcComponent, ProductDetailEcComponent, ProductDetailService, ProductEcComponent, ProductOffDirective, ProductStockDirective, ProductsService, ReCaptchaEcComponent, ReCaptchaService, RegisterFormEcComponent, RegisterWholesalerFormEcComponent, ShipmentService, SidebarEcComponent, SuccessEcComponent, TestService, ToastService, VariantsEcComponent, authGuard, authInterceptor, directives, provideEnvironment };
|
|
8228
8892
|
//# sourceMappingURL=ng-easycommerce-v18.mjs.map
|