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