[-] CORE : Fix issue with delivery option

Happens after a payment redirection error, delivery_option is not sent
(but should be set in the cart context)
This commit is contained in:
Vincent Schoener
2013-03-28 12:45:03 +01:00
parent 02baab7393
commit 312e16a926
+6 -2
View File
@@ -155,14 +155,18 @@ class OrderControllerCore extends ParentOrderController
Tools::redirect('index.php?controller=order&step=2');
Context::getContext()->cookie->check_cgv = true;
// Check the delivery option is setted
// Check the delivery option is set
if (!$this->context->cart->isVirtualCart())
{
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') && !$this->context->cart->id_carrier)
{
foreach (Tools::getValue('delivery_option') as $delivery_option)
$deliveries_options = Tools::getValue('delivery_option');
if (!$deliveries_options) {
$deliveries_options = $this->context->cart->delivery_option;
}
foreach ($deliveries_options as $delivery_option)
if (empty($delivery_option))
Tools::redirect('index.php?controller=order&step=2');
}