diff --git a/src/app/components/inicio/inicio.component.ts b/src/app/components/inicio/inicio.component.ts index 4fc11fe..cc5f749 100644 --- a/src/app/components/inicio/inicio.component.ts +++ b/src/app/components/inicio/inicio.component.ts @@ -117,15 +117,17 @@ export class InicioComponent implements OnInit { var codigo = this.promoAcargar.codigo; this.productoService.getPromocionSinonimos(sector, codigo) .subscribe((res: Sinonimo[]) => { + res.forEach(resSinonimo => { - resSinonimo.productos.forEach(productoSinonimo => { - this.promoAcargar.productos.forEach(productoPromo => { - if (productoPromo.id === productoSinonimo.id) { - productoSinonimo.esPadre = true; - } - }); - - }) + + this.promoAcargar.productos.forEach(productoPromo => { + + if (productoPromo.idSinonimo === resSinonimo.ID_SIN) { + resSinonimo.cantidad = productoPromo.cantidad; + resSinonimo.productoPadre = productoPromo.id; + } + }); + }) this.sinonimos = res; this.showPopover(); diff --git a/src/app/components/popover-sinonimos/popover-sinonimos.component.html b/src/app/components/popover-sinonimos/popover-sinonimos.component.html index b158ad0..859c8db 100644 --- a/src/app/components/popover-sinonimos/popover-sinonimos.component.html +++ b/src/app/components/popover-sinonimos/popover-sinonimos.component.html @@ -10,41 +10,41 @@
- Elija una opción + Elija una opción - Cantidad Restante {{cantidadRestanteSinonimos[i]}}
+ {{producto.DetArt}} +