Commit 55a68043f082c9f0ee76b9b2a8555d7e2380fbee

Authored by Marcelo Puebla
1 parent b695e77f11
Exists in master and in 1 other branch validar_pve

Logica empezada para poder personalizar un producto en el carrito,

src/app/components/sidebar/sidebar.component.html
... ... @@ -10,7 +10,7 @@
10 10 <div
11 11 class="slide-in-bl my-2 bg-white border-0 rounded-sm"
12 12 *ngFor="let producto of productosCarrito.slice().reverse(); let i = index">
13   - <img class="w-100 m-auto rounded-sm shadow" src="{{apiUrl}}/imagenes/{{producto.imagenes[0].imagen}}">
  13 + <!-- <img class="w-100 m-auto rounded-sm shadow" src="{{apiUrl}}/imagenes/{{producto.imagenes[0].imagen}}"> -->
14 14 <div class="row m-0 p-0 px-1 py-1 shadow rounded-sm">
15 15 <div class="col-12 p-0 pt-2 text-left my-auto">
16 16 <p class="m-0 h6"><small>{{producto.DetArt}}</small></p>
... ... @@ -36,7 +36,11 @@
36 36 </div>
37 37 <div class="col-6 px-2 my-2">
38 38 <div class="btn-group-sm btn-group float-right my-auto" role="group">
39   - <button type="button" class="btn btn-light btn-sm my-auto float-left border mr-2">
  39 + <button
  40 + *ngIf="esPersonalizable(producto)"
  41 + type="button"
  42 + class="btn btn-light btn-sm my-auto float-left border mr-2"
  43 + (click)="personalizarPromo">
40 44 <i class="fa fa-hand-o-up" aria-hidden="true"></i>
41 45 </button>
42 46 <button type="button" class="btn btn-secondary btn-sm my-auto ml-2" (click)="deleteProducto(i)">
src/app/components/sidebar/sidebar.component.ts
... ... @@ -20,7 +20,7 @@ export class SidebarComponent implements OnInit {
20 20 public productosCarrito: Producto[] = [];
21 21  
22 22 constructor(private productoService: ProductoService) {
23   -
  23 +
24 24 this.productosCarrito = this.productoService.productos;
25 25 }
26 26  
... ... @@ -99,4 +99,14 @@ export class SidebarComponent implements OnInit {
99 99 this.total = 0;
100 100 this.cont = 0;
101 101 }
  102 +
  103 + esPersonalizable(producto: Producto) {
  104 +
  105 + var esPersonalizable: boolean = false;
  106 + if (producto.tieneSinonimos)
  107 + esPersonalizable = true;
  108 +
  109 + return esPersonalizable;
  110 + }
  111 +
102 112 }