示例#1
0
 /**
  * @return \Illuminate\Http\RedirectResponse
  */
 public function instance()
 {
     $product = $this->product->eagerLoadWhere('product_translations', \Input::get('id'));
     Cart::add(['id' => \Input::get('id'), 'name' => $product->product_translations[0]->name, 'qty' => 1, 'price' => $product->price, 'options' => ['img' => $product->img_big, 'sku' => $product->sku, 'currency' => $product->currency]]);
     return redirect()->back()->with('flash_success', 'Product is added to the cart');
 }
 public function show($id)
 {
     //dd($this->product->eagerLoadWhere('',$id));
     return Theme::view('frontend.product.show')->withProduct($this->product->eagerLoadWhere('', $id))->withProducts($this->product->eagerLoadPaginated(10));
 }