I need the route cart.view for the OrderException.php file.
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user