mirror of
https://github.com/kevinveenbirkenbach/coding-challenge-online-shop.git
synced 2024-12-22 23:25:03 +01:00
Added unregistered error
This commit is contained in:
parent
306c38c2b2
commit
55e18fa608
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user