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 -->
<!-- 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">
<default key="_controller">Thelia\Controller\Front\CartController::addItem</default>
</route>

View File

@@ -64,7 +64,7 @@ class BaseFrontController extends BaseController
{
$cart = $this->getSession()->getCart();
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());
if ($cart->getCartItems()->count() > 0) {
$this->redirectToRoute('default', array('view'=>'cart'));
$this->redirectToRoute('cart.view');
} else {
$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()))));
} else {
/* 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 */
$placedOrder = OrderQuery::create()->findPk(
$this->getRequest()->attributes->get('order_id')
$this->getRequest()->attributes->get('order_id');
);
if (null === $placedOrder) {