public function saveCurrentCart() { $cart = $this->getCurrentCart(); if ($cart->hasItems()) { if ($cart->getId() === null) { $this->cartService->create($cart); $this->cartSession->cartId = $cart->getId(); } else { $this->cartService->update($cart); } } }