diff --git a/src/controller/order/Order.php b/src/controller/order/Order.php index f15936d..82ca7fc 100644 --- a/src/controller/order/Order.php +++ b/src/controller/order/Order.php @@ -44,6 +44,9 @@ final class Order extends AbstractDefaultController implements OrderInterface private function store(): void { + if(!$this->core->getUser()){ + throw new \Exception('Just registered users can order!'); + } $this->core->getBasket()->setCustomer($this->core->getUser()); if ($this->orderRepository->saveOrder($this->core->getBasket())) { $this->core->setBasket(new OrderEntity());