This commit is contained in:
Kevin Frantz
2018-07-15 16:41:56 +02:00
parent 990d65aa9a
commit 1492282ae5
17 changed files with 129 additions and 91 deletions

View File

@@ -45,9 +45,9 @@ final class Order extends AbstractDefaultController implements OrderInterface
private function store(): void
{
$this->core->getBasket()->setCustomer($this->core->getUser());
if($this->orderRepository->saveOrder($this->core->getBasket())){
if ($this->orderRepository->saveOrder($this->core->getBasket())) {
$this->core->setBasket(new OrderEntity());
}else{
} else {
throw new \Exception('Order could not be saved!');
}
}
@@ -59,7 +59,7 @@ final class Order extends AbstractDefaultController implements OrderInterface
}
$this->render('order/basket.html.twig', [
'basket' => $this->core->getBasket(),
'payment_methods'=>AbstractPayment::getPaymentMethods(),
'payment_methods' => AbstractPayment::getPaymentMethods()
]);
}
@@ -68,7 +68,7 @@ final class Order extends AbstractDefaultController implements OrderInterface
if ($this->post['add']) {
$this->addProduct();
}
if ($this->post['store']){
if ($this->post['store']) {
$this->store();
}
}