Commit f6197c11d6b957328c21f219d02fda23f8c32a38

Authored by Marcelo Puebla
1 parent 55145dded6
Exists in master

Arreglo para la cantidad.

src/app/components/confirmacion-carrito/confirmacion-carrito.component.html
... ... @@ -50,7 +50,7 @@
50 50 <div *ngIf="producto.tieneSinonimos">
51 51 <p *ngFor="let p of producto.productos" class="h6 text-left m-0">
52 52 <small>
53   - - {{p.cantidad * producto.cantidad}} {{p.DET_LAR}}
  53 + - {{p.cantidad}} {{p.DET_LAR}}
54 54 </small>
55 55 </p>
56 56 </div>
src/app/components/sidebar/sidebar.component.ts
... ... @@ -56,6 +56,11 @@ export class SidebarComponent implements OnInit {
56 56 aumentarCantidad(producto: Producto) {
57 57  
58 58 if (producto.cantidad < this.cantMax) {
  59 + if (producto.PRO) {
  60 + producto.productos.forEach(promoProducto => {
  61 + promoProducto.cantidad++;
  62 + })
  63 + }
59 64 producto.cantidad++;
60 65 this.cantTotal++
61 66 }
... ... @@ -64,6 +69,11 @@ export class SidebarComponent implements OnInit {
64 69 restarCantidad(producto: Producto) {
65 70  
66 71 if (producto.cantidad > this.cantMin) {
  72 + if (producto.PRO) {
  73 + producto.productos.forEach(promoProducto => {
  74 + promoProducto.cantidad--;
  75 + })
  76 + }
67 77 producto.cantidad--;
68 78 this.cantTotal--;
69 79 }