// Merge -> 10309

This commit is contained in:
rMalie
2011-11-21 11:05:10 +00:00
parent 3bfd9ad4ca
commit 82c9dead2a
365 changed files with 11185 additions and 1571 deletions
+16 -10
View File
@@ -64,18 +64,26 @@ class OrderControllerCore extends ParentOrderController
if (!$this->context->customer->isLogged(true) && in_array($this->step, array(1, 2, 3)))
Tools::redirect('index.php?controller=authentication&back='.urlencode('order.php&step='.$this->step));
if (Tools::getValue('multi-shipping') == 1)
$this->context->smarty->assign('multi_shipping', true);
else
$this->context->smarty->assign('multi_shipping', false);
if ($this->context->customer->id)
$this->context->smarty->assign('address_list', $this->context->customer->getAddresses($this->context->language->id));
else
$this->context->smarty->assign('address_list', array());
}
public function postProcess()
{
// Update carrier selected on preProccess in order to fix a bug of
// block cart when it's hooked on leftcolumn
if ($this->step == 3 && Tools::isSubmit('processCarrier'))
$this->processCarrier();
}
/**
* Assign template vars related to page content
* @see FrontController::initContent()
@@ -94,7 +102,7 @@ class OrderControllerCore extends ParentOrderController
$this->context->smarty->assign('empty', 1);
$this->setTemplate(_PS_THEME_DIR_.'shopping-cart.tpl');
break;
case 1:
$this->_assignAddress();
$this->processAddressFormat();
@@ -118,11 +126,9 @@ class OrderControllerCore extends ParentOrderController
case 3:
// Test that the conditions (so active) were accepted by the customer
$cgv = Tools::getValue('cgv');
if (Configuration::get('PS_CONDITIONS') && (!Validate::isBool($cgv)))
if (Configuration::get('PS_CONDITIONS') && (!Validate::isBool($cgv) || $cgv == false))
Tools::redirect('index.php?controller=order&step=2');
if (Tools::isSubmit('processCarrier'))
$this->processCarrier();
$this->autoStep();
// Bypass payment step if total is 0
@@ -201,9 +207,9 @@ class OrderControllerCore extends ParentOrderController
{
if (!Tools::getValue('multi-shipping'))
$this->context->cart->setNoMultishipping();
// Add checking for all addresses
if (!Tools::isSubmit('id_address_delivery') || !Address::isCountryActiveById((int)Tools::getValue('id_address_delivery')))
$this->errors[] = Tools::displayError('This address is not in a valid area.');
else
@@ -247,7 +253,7 @@ class OrderControllerCore extends ParentOrderController
}
$orderTotal = $this->context->cart->getOrderTotal();
}
/**
* Address step
*/
@@ -257,7 +263,7 @@ class OrderControllerCore extends ParentOrderController
if (Tools::getValue('multi-shipping'))
$this->context->cart->autosetProductAddress();
$this->context->smarty->assign('cart', $this->context->cart);
if ($this->context->customer->is_guest)
Tools::redirect('index.php?controller=order&step=2');