[-] FO : First part of fix #PSCFV-8636, cart rule on specifice carrier / all carriers

This commit is contained in:
gRoussac
2013-04-15 18:30:41 +02:00
parent 5989481859
commit eca4a87082
3 changed files with 17 additions and 7 deletions
+1 -1
View File
@@ -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)
)); ));
} }
+2 -2
View File
@@ -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')),
@@ -498,7 +498,17 @@ class ParentOrderControllerCore extends FrontController
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')),