From fd918561c57de9d1cb3c90fb57fe32c5bf6bdc2d Mon Sep 17 00:00:00 2001 From: = <=> Date: Wed, 7 Aug 2019 11:47:14 -0300 Subject: [PATCH] Funcion incrementar 2 --- src/app/sidebar/sidebar.component.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/app/sidebar/sidebar.component.ts b/src/app/sidebar/sidebar.component.ts index 6405d7c..ba4f1b4 100644 --- a/src/app/sidebar/sidebar.component.ts +++ b/src/app/sidebar/sidebar.component.ts @@ -63,12 +63,9 @@ export class SidebarComponent implements OnInit { getTotal(){ var subTotal; - for (const pr of this.productos) { - subTotal = pr.cantidad * pr.precio; + for (let i = 0; i < this.productos.length; i++) { + this.productos[i].cantidad; } - this.total = this.total + subTotal; - this.total = this.total * this.cont; - return this.total; } public aumentarContador(index) { -- 1.9.1