Merge branch 'master' of github.com:thelia/thelia

This commit is contained in:
Manuel Raynaud
2013-10-24 19:20:18 +02:00
5 changed files with 47 additions and 44 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'));
}
}

View File

@@ -355,15 +355,17 @@ class Product extends BaseI18nLoop
$search->groupBy(ProductTableMap::ID);
$search->withColumn('ROUND(' . $priceToCompareAsSQL . ', 2)', 'real_price');
$search->withColumn('`price`.PRICE', 'price');
$search->withColumn('`price`.PROMO_PRICE', 'promo_price');
$search->withColumn('`pse`.ID', 'pse_id');
$search->withColumn('`pse`.NEWNESS', 'is_new');
$search->withColumn('`pse`.PROMO', 'is_promo');
$search->withColumn('`pse`.QUANTITY', 'quantity');
$search->withColumn('`pse`.WEIGHT', 'weight');
$search->withColumn('`pse`.EAN_CODE', 'ean_code');
$search->withColumn('ROUND(' . $priceToCompareAsSQL . ', 2)', 'real_price');
$search->withColumn('`price`.PRICE', 'price');
$search->withColumn('`price`.PROMO_PRICE', 'promo_price');
$orders = $this->getOrder();
foreach ($orders as $order) {
@@ -489,6 +491,7 @@ class Product extends BaseI18nLoop
->set("PROMO_PRICE" , $promoPrice)
->set("PROMO_PRICE_TAX" , $taxedPromoPrice - $promoPrice)
->set("TAXED_PROMO_PRICE" , $taxedPromoPrice)
->set("PRODUCT_SALE_ELEMENT" , $product->getVirtualColumn('pse_id'))
->set("WEIGHT" , $product->getVirtualColumn('weight'))
->set("QUANTITY" , $product->getVirtualColumn('quantity'))
->set("EAN_CODE" , $product->getVirtualColumn('ean_code'))