I need the route cart.view for the OrderException.php file.

This commit is contained in:
touffies
2013-10-24 19:39:54 +02:00
parent ca5d7d2a00
commit b0fb0fdd43
4 changed files with 9 additions and 4 deletions

View File

@@ -95,6 +95,11 @@
<!-- end customer address routes --> <!-- end customer address routes -->
<!-- cart routes --> <!-- cart routes -->
<route id="cart.view" path="/cart">
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
<default key="_view">cart</default>
</route>
<route id="cart.add.process" path="/cart/add"> <route id="cart.add.process" path="/cart/add">
<default key="_controller">Thelia\Controller\Front\CartController::addItem</default> <default key="_controller">Thelia\Controller\Front\CartController::addItem</default>
</route> </route>

View File

@@ -64,7 +64,7 @@ class BaseFrontController extends BaseController
{ {
$cart = $this->getSession()->getCart(); $cart = $this->getSession()->getCart();
if ($cart===null || $cart->countCartItems() == 0) { if ($cart===null || $cart->countCartItems() == 0) {
$this->redirectToRoute('default', array('view'=>'cart')); $this->redirectToRoute('cart.view');
} }
} }

View File

@@ -109,7 +109,7 @@ class CustomerController extends BaseFrontController
$cart = $this->getCart($this->getRequest()); $cart = $this->getCart($this->getRequest());
if ($cart->getCartItems()->count() > 0) { if ($cart->getCartItems()->count() > 0) {
$this->redirectToRoute('default', array('view'=>'cart')); $this->redirectToRoute('cart.view');
} else { } else {
$this->redirectSuccess($customerCreation); $this->redirectSuccess($customerCreation);
} }

View File

@@ -197,7 +197,7 @@ class OrderController extends BaseFrontController
$this->redirect(URL::getInstance()->absoluteUrl($this->getRoute('order.placed', array('order_id' => $orderEvent->getPlacedOrder()->getId())))); $this->redirect(URL::getInstance()->absoluteUrl($this->getRoute('order.placed', array('order_id' => $orderEvent->getPlacedOrder()->getId()))));
} else { } else {
/* order has not been placed */ /* order has not been placed */
$this->redirectToRoute('default', array('view'=>'cart')); $this->redirectToRoute('cart.view');
} }
} }
@@ -205,7 +205,7 @@ class OrderController extends BaseFrontController
{ {
/* check if the placed order matched the customer */ /* check if the placed order matched the customer */
$placedOrder = OrderQuery::create()->findPk( $placedOrder = OrderQuery::create()->findPk(
$this->getRequest()->attributes->get('order_id') $this->getRequest()->attributes->get('order_id');
); );
if (null === $placedOrder) { if (null === $placedOrder) {