/**
  * Send order email to admin
  *
  * @param $order
  * @param $cartTotals
  * @return bool
  */
 public function sendOrderEmailToAdmin($order, $cartTotals)
 {
     //get cart contents
     $cartContents = $this->sessionCartRepo->getCartBySessionId($order->session_id);
     //send email
     Mail::send('emails.admin-order', ['cartContents' => $cartContents, 'cartTotals' => $cartTotals, 'orderInfo' => $order->info], function ($message) {
         $message->from($this->admin_email);
         $message->to($this->admin_email);
     });
     //just return true here
     return true;
 }
Beispiel #2
0
 /**
  * Change item cart quantity
  *
  * @param Request $request
  * @return \Illuminate\Http\JsonResponse
  */
 public function updateCartQuantity(Request $request)
 {
     //get product by url
     $product = $this->productRepo->findByUrl($request->get('url'));
     //get session cart instance
     $sessionCart = $this->sessionCartRepo->findBySessionIdAndProductId($this->sessionId, $product->id);
     //update the new quantity
     $sessionCart->update($request->all());
     //return response
     return response()->json(['success' => 'Cart item quantity updated']);
 }