Commit 7c801ad76d436f01e8421d353820c0c26c1c118d

Authored by Eric Fernandez
1 parent 35cfb8e487
Exists in master

filtro sólo productos que tienen sinónimo

Showing 1 changed file with 8 additions and 2 deletions   Show diff stats
src/app/components/inicio/inicio.component.ts
... ... @@ -92,8 +92,14 @@ export class InicioComponent implements OnInit, AfterViewInit {
92 92  
93 93 confirmarProducto() {
94 94  
95   - var producto = this.promoAcargar ? this.promoAcargar : this.productoAcargar;
  95 + let producto = this.promoAcargar ? this.promoAcargar : this.productoAcargar;
  96 +
  97 + producto.productos = producto.productos.filter(producto => {
  98 + return producto.idSinonimo > 0;
  99 + });
  100 +
96 101 producto.cantidad = producto.cantidad ? producto.cantidad : 1;
  102 +
97 103 this.productoService.setProductos(producto);
98 104 this.productoService.productoAcargar = this.promoAcargar = this.productoAcargar = undefined;
99 105 this.productoService.esPromoPersonalizada = false;
... ... @@ -147,7 +153,7 @@ export class InicioComponent implements OnInit, AfterViewInit {
147 153  
148 154 productosPersonalizados($event: Producto[]) {
149 155  
150   - var productosPersonalizados = $event;
  156 + let productosPersonalizados = $event;
151 157 this.promoAcargar.productos = productosPersonalizados;
152 158 this.confirmarProducto();
153 159 }