Commit a1d4c0dc17e998d0afa04fe688aa70bed1e591ed
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master(efernandez) See merge request !93
Showing
1 changed file
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 | } |