From e4a951a25e22cdc61d411b8b3897060b1f7db9d1 Mon Sep 17 00:00:00 2001 From: mpuebla Date: Wed, 21 Aug 2019 09:52:06 -0300 Subject: [PATCH] Agregada cantidad igual a 1 al agregar productos al carrito. --- src/app/components/inicio/inicio.component.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/components/inicio/inicio.component.ts b/src/app/components/inicio/inicio.component.ts index 3a01863..00fd0f2 100644 --- a/src/app/components/inicio/inicio.component.ts +++ b/src/app/components/inicio/inicio.component.ts @@ -65,6 +65,7 @@ export class InicioComponent implements OnInit { if (res.length === 0) { //Si no tiene promociones la cargará al carrito despues de un tiempo setTimeout(() => { + this.productoAcargar.cantidad = 1; this.productoService.productos.push(this.productoAcargar); this.productoAcargar = this.productoService.productoAcargar = undefined; }, 2000) @@ -95,7 +96,7 @@ export class InicioComponent implements OnInit { } confirmarProducto() { - + this.promoAcargar.cantidad = 1; this.productoService.productos.push(this.promoAcargar); this.promoAcargar = undefined; this.productoAcargar = undefined; @@ -112,11 +113,11 @@ export class InicioComponent implements OnInit { if (this.promoAcargar) { this.promoAcargar = undefined; - if(this.productoAcargar.PRO){ + if (this.productoAcargar.PRO) { this.productoAcargar = undefined; this.promociones = []; this.popoverDirective.hide(); - }else{ + } else { this.popoverDirective.show(); } } else { -- 1.9.1