Exemple #1
0
 public function getProcesePurchase($id)
 {
     $title = "Metodo de pago | Nia Boutique.com";
     $fac = Facturas::find($id);
     $x = FacturaItem::where('factura_id', '=', $id)->sum('item_qty');
     $aux = FacturaItem::where('factura_id', '=', $id)->get(array('item_id', 'item_qty', 'item_talla', 'item_color', 'item_precio'));
     $i = 0;
     $auxT = 0;
     $auxQ = 0;
     $p = '';
     foreach ($aux as $a) {
         $b = Items::where('item.id', '=', $a->item_id)->first();
         $p = $p . $b->item_nomb . ', ';
         $b->qty = $a->item_qty;
         $b->precio = $a->item_precio;
         $b->item_talla = Tallas::where('id', '=', $a->item_talla)->pluck('talla_desc');
         $b->item_color = Colores::where('id', '=', $a->item_color)->pluck('color_desc');
         $auxT = $auxT + $b->qty * $b->item_precio;
         $auxQ = $auxQ + $b->qty;
         $aux = Misc::where('item_id', '=', $a->item_id)->where('deleted', '=', 0)->first();
         $b->img = Images::where('misc_id', '=', $aux->id)->where('deleted', '=', 0)->first();
         $item[$i] = $b;
         $i++;
     }
     $total = 0;
     $method = 'hola';
     $bancos = Bancos::where('deleted', '=', 0)->get();
     return View::make('indexs.showCart')->with('title', $title)->with('method', $method)->with('total', $total)->with('items', $item)->with('id', $id)->with('bancos', $bancos);
 }
Exemple #2
0
 public function getNewMisc($id)
 {
     $title = "Nueva Caracteristica";
     $item = Items::find($id);
     $misc = Misc::where('item_id', '=', $item->id)->get();
     $item->misc = $misc;
     $cat = Cat::where('deleted', '=', 0)->get();
     $tallas = Tallas::where('deleted', '=', 0)->get();
     $colors = Colores::where('deleted', '=', 0)->get();
     return View::make('admin.newMisc')->with('title', $title)->with('item', $item)->with('cat', $cat)->with('tallas', $tallas)->with('colores', $colors);
 }