diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index 403ebd238..3fb38dd26 100755 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -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'))) && diff --git a/controllers/front/OrderController.php b/controllers/front/OrderController.php index e1a07f9bc..adeaa0fb5 100644 --- a/controllers/front/OrderController.php +++ b/controllers/front/OrderController.php @@ -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'); } }