[-] FO: Fix #PSCFV-4370

This commit is contained in:
rGaillard
2012-09-25 14:42:30 +00:00
parent 39a51e388e
commit 4e91bb2188
2 changed files with 9 additions and 5 deletions
+3
View File
@@ -188,7 +188,10 @@ class FrontControllerCore extends Controller
{
$cart = new Cart($this->context->cookie->id_cart);
if ($cart->OrderExists())
{
unset($this->context->cookie->id_cart, $cart, $this->context->cookie->checkedTOS);
$this->context->cookie->check_cgv = false;
}
/* Delete product of cart, if user can't make an order from his country */
elseif (intval(Configuration::get('PS_GEOLOCATION_ENABLED')) &&
!in_array(strtoupper($this->context->cookie->iso_code_country), explode(';', Configuration::get('PS_ALLOWED_COUNTRIES'))) &&
+6 -5
View File
@@ -147,20 +147,21 @@ class OrderControllerCore extends ParentOrderController
case 3:
// Check that the conditions (so active) were accepted by the customer
$cgv = Tools::getValue('cgv');
$cgv = Tools::getValue('cgv') || $this->context->cookie->check_cgv;
if (Configuration::get('PS_CONDITIONS') && (!Validate::isBool($cgv) || $cgv == false))
Tools::redirect('index.php?controller=order&step=2');
Context::getContext()->cookie->check_cgv = true;
// Check the delivery option is setted
if (!$this->context->cart->isVirtualCart())
{
if (!Tools::getValue('delivery_option') && !Tools::getValue('id_carrier'))
if (!Tools::getValue('delivery_option') && !Tools::getValue('id_carrier') && !$this->context->cart->delivery_option && !$this->context->cart->id_carrier)
Tools::redirect('index.php?controller=order&step=2');
elseif (!Tools::getValue('id_carrier'))
elseif (!Tools::getValue('id_carrier') && !$this->context->cart->id_carrier)
{
foreach (Tools::getValue('delivery_option') as $delivery_option)
if (empty($delivery_option))
Tools::redirect('index.php?controller=order&step=2');
if (empty($delivery_option))
Tools::redirect('index.php?controller=order&step=2');
}
}