Change some route to use the default

$this->redirectToRoute('default', array('view'=>'cart'));
This commit is contained in:
touffies
2013-10-24 18:51:49 +02:00
parent ebec82d1d2
commit ca5d7d2a00
4 changed files with 10 additions and 10 deletions

View File

@@ -101,7 +101,7 @@ class AddressController extends BaseFrontController
$address = AddressQuery::create()->findPk($address_id);
if (!$address || $customer->getId() != $address->getCustomerId()) {
$this->redirectToRoute("home");
$this->redirectToRoute('default');
}
$this->getParserContext()->set("address_id", $address_id);
@@ -122,11 +122,11 @@ class AddressController extends BaseFrontController
$address = AddressQuery::create()->findPk($address_id);
if (null === $address) {
$this->redirectToRoute("home");
$this->redirectToRoute('default');
}
if ($address->getCustomer()->getId() != $customer->getId()) {
$this->redirectToRoute("home");
$this->redirectToRoute('default');
}
$event = $this->createAddressEvent($form);
@@ -161,12 +161,12 @@ class AddressController extends BaseFrontController
$address = AddressQuery::create()->findPk($address_id);
if (!$address || $customer->getId() != $address->getCustomerId()) {
$this->redirectToRoute("home");
$this->redirectToRoute('default');
}
$this->dispatch(TheliaEvents::ADDRESS_DELETE, new AddressEvent($address));
$this->redirectToRoute("customer.account.view");
$this->redirectToRoute('default', array('view'=>'account'));
}
protected function createAddressEvent($form)

View File

@@ -56,7 +56,7 @@ class BaseFrontController extends BaseController
public function checkAuth()
{
if ($this->getSecurityContext()->hasCustomerUser() === false) {
$this->redirectToRoute("customer.login.view");
$this->redirectToRoute('default', array('view'=>'login'));
}
}
@@ -64,7 +64,7 @@ class BaseFrontController extends BaseController
{
$cart = $this->getSession()->getCart();
if ($cart===null || $cart->countCartItems() == 0) {
$this->redirectToRoute("cart.view");
$this->redirectToRoute('default', array('view'=>'cart'));
}
}

View File

@@ -109,7 +109,7 @@ class CustomerController extends BaseFrontController
$cart = $this->getCart($this->getRequest());
if ($cart->getCartItems()->count() > 0) {
$this->redirectToRoute("cart.view");
$this->redirectToRoute('default', array('view'=>'cart'));
} else {
$this->redirectSuccess($customerCreation);
}
@@ -278,7 +278,7 @@ class CustomerController extends BaseFrontController
// If User is a new customer
if ($form->get('account')->getData() == 0 && !$form->get("email")->getErrors()) {
$this->redirectToRoute("customer.create.view", array("email" => $form->get("email")->getData()));
$this->redirectToRoute("default", array("view" => "register","email" => $form->get("email")->getData()));
} else {
try {

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("cart.view");
$this->redirectToRoute('default', array('view'=>'cart'));
}
}