Beispiel #1
0
 /**
  * @return Cart
  */
 private function getCartOrCreateNew()
 {
     $cart = merx_current_cart();
     if (!$cart) {
         $cart = Cart::create();
         session()->put("merx_cart_id", $cart->id);
     }
     return $cart;
 }
Beispiel #2
0
 private function newCart()
 {
     return Cart::create();
 }
Beispiel #3
0
 protected function createCartAndClient()
 {
     $cart = Cart::create();
     session()->put("merx_cart_id", $cart->id);
     $cart->addItem(new CartItem($this->itemAttributes()));
     $this->loginClient();
 }
Beispiel #4
0
 /**
  * @return Cart
  */
 private function newCart()
 {
     $cart = Cart::create();
     if (config("merx.uses_session", true)) {
         session()->put("merx_cart_id", $cart->id);
     }
     return $cart;
 }