diff --git a/controllers/front/OrderController.php b/controllers/front/OrderController.php index 190bdd1de..80b4775bb 100644 --- a/controllers/front/OrderController.php +++ b/controllers/front/OrderController.php @@ -347,7 +347,7 @@ class OrderControllerCore extends ParentOrderController $this->context->smarty->assign( array( - 'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only + // 'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only 'is_guest' => (isset($this->context->customer->is_guest) ? $this->context->customer->is_guest : 0) )); } diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index fcc6fb222..9b90e22a4 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -316,7 +316,7 @@ class OrderOpcControllerCore extends ParentOrderController // If a rule offer free-shipping, force hidding shipping prices $free_shipping = false; foreach ($this->context->cart->getCartRules() as $rule) - if ($rule['free_shipping']) + if ($rule['free_shipping'] && !$rule['carrier_restriction']) { $free_shipping = true; break; @@ -500,7 +500,7 @@ class OrderOpcControllerCore extends ParentOrderController $oldMessage = Message::getMessageByCartId((int)($this->context->cart->id)); $vars = array( - 'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only + // 'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only 'checkedTOS' => (int)($this->context->cookie->checkedTOS), 'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')), 'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')), diff --git a/controllers/front/ParentOrderController.php b/controllers/front/ParentOrderController.php index 164ba87b2..3483b2cce 100644 --- a/controllers/front/ParentOrderController.php +++ b/controllers/front/ParentOrderController.php @@ -454,15 +454,15 @@ class ParentOrderControllerCore extends FrontController } protected function _assignCarrier() - { + { $address = new Address($this->context->cart->id_address_delivery); $id_zone = Address::getZoneById($address->id); $carriers = $this->context->cart->simulateCarriersOutput(); $checked = $this->context->cart->simulateCarrierSelectedOutput(); $delivery_option_list = $this->context->cart->getDeliveryOptionList(); $this->setDefaultCarrierSelection($delivery_option_list); - - $this->context->smarty->assign(array( + + $this->context->smarty->assign(array( 'address_collection' => $this->context->cart->getAddressCollection(), 'delivery_option_list' => $delivery_option_list, 'carriers' => $carriers, @@ -497,8 +497,18 @@ class ParentOrderControllerCore extends FrontController $this->link_conditions .= '?content_only=1'; else $this->link_conditions .= '&content_only=1'; - + + $free_shipping = false; + foreach ($this->context->cart->getCartRules() as $rule) + { + if ($rule['free_shipping'] && !$rule['carrier_restriction']) + { + $free_shipping = true; + break; + } + } $this->context->smarty->assign(array( + 'free_shipping' => $free_shipping, 'checkedTOS' => (int)($this->context->cookie->checkedTOS), 'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')), 'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),