[-] FO : First part of fix #PSCFV-8636, cart rule on specifice carrier / all carriers
This commit is contained in:
@@ -347,7 +347,7 @@ class OrderControllerCore extends ParentOrderController
|
|||||||
|
|
||||||
$this->context->smarty->assign(
|
$this->context->smarty->assign(
|
||||||
array(
|
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)
|
'is_guest' => (isset($this->context->customer->is_guest) ? $this->context->customer->is_guest : 0)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
|||||||
// If a rule offer free-shipping, force hidding shipping prices
|
// If a rule offer free-shipping, force hidding shipping prices
|
||||||
$free_shipping = false;
|
$free_shipping = false;
|
||||||
foreach ($this->context->cart->getCartRules() as $rule)
|
foreach ($this->context->cart->getCartRules() as $rule)
|
||||||
if ($rule['free_shipping'])
|
if ($rule['free_shipping'] && !$rule['carrier_restriction'])
|
||||||
{
|
{
|
||||||
$free_shipping = true;
|
$free_shipping = true;
|
||||||
break;
|
break;
|
||||||
@@ -500,7 +500,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
|||||||
$oldMessage = Message::getMessageByCartId((int)($this->context->cart->id));
|
$oldMessage = Message::getMessageByCartId((int)($this->context->cart->id));
|
||||||
|
|
||||||
$vars = array(
|
$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),
|
'checkedTOS' => (int)($this->context->cookie->checkedTOS),
|
||||||
'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')),
|
'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')),
|
||||||
'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),
|
'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),
|
||||||
|
|||||||
@@ -454,15 +454,15 @@ class ParentOrderControllerCore extends FrontController
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function _assignCarrier()
|
protected function _assignCarrier()
|
||||||
{
|
{
|
||||||
$address = new Address($this->context->cart->id_address_delivery);
|
$address = new Address($this->context->cart->id_address_delivery);
|
||||||
$id_zone = Address::getZoneById($address->id);
|
$id_zone = Address::getZoneById($address->id);
|
||||||
$carriers = $this->context->cart->simulateCarriersOutput();
|
$carriers = $this->context->cart->simulateCarriersOutput();
|
||||||
$checked = $this->context->cart->simulateCarrierSelectedOutput();
|
$checked = $this->context->cart->simulateCarrierSelectedOutput();
|
||||||
$delivery_option_list = $this->context->cart->getDeliveryOptionList();
|
$delivery_option_list = $this->context->cart->getDeliveryOptionList();
|
||||||
$this->setDefaultCarrierSelection($delivery_option_list);
|
$this->setDefaultCarrierSelection($delivery_option_list);
|
||||||
|
|
||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
'address_collection' => $this->context->cart->getAddressCollection(),
|
'address_collection' => $this->context->cart->getAddressCollection(),
|
||||||
'delivery_option_list' => $delivery_option_list,
|
'delivery_option_list' => $delivery_option_list,
|
||||||
'carriers' => $carriers,
|
'carriers' => $carriers,
|
||||||
@@ -497,8 +497,18 @@ class ParentOrderControllerCore extends FrontController
|
|||||||
$this->link_conditions .= '?content_only=1';
|
$this->link_conditions .= '?content_only=1';
|
||||||
else
|
else
|
||||||
$this->link_conditions .= '&content_only=1';
|
$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(
|
$this->context->smarty->assign(array(
|
||||||
|
'free_shipping' => $free_shipping,
|
||||||
'checkedTOS' => (int)($this->context->cookie->checkedTOS),
|
'checkedTOS' => (int)($this->context->cookie->checkedTOS),
|
||||||
'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')),
|
'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')),
|
||||||
'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),
|
'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),
|
||||||
|
|||||||
Reference in New Issue
Block a user