// Cart display for free shipping
This commit is contained in:
+2
-6
@@ -1424,7 +1424,7 @@ class CartCore extends ObjectModel
|
|||||||
}
|
}
|
||||||
|
|
||||||
$order_total_discount = 0;
|
$order_total_discount = 0;
|
||||||
if ($type != Cart::ONLY_PRODUCTS && CartRule::isFeatureActive())
|
if (!in_array($type, array(Cart::ONLY_SHIPPING, Cart::ONLY_PRODUCTS)) && CartRule::isFeatureActive())
|
||||||
{
|
{
|
||||||
// First, retrieve the cart rules associated to this "getOrderTotal"
|
// First, retrieve the cart rules associated to this "getOrderTotal"
|
||||||
if ($with_shipping)
|
if ($with_shipping)
|
||||||
@@ -2664,11 +2664,7 @@ class CartCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
$cart_rule['value_real'] -= $total_shipping;
|
$cart_rule['value_real'] -= $total_shipping;
|
||||||
$cart_rule['value_tax_exc'] = $total_shipping_tax_exc;
|
$cart_rule['value_tax_exc'] = $total_shipping_tax_exc;
|
||||||
|
|
||||||
// Update total discounts
|
|
||||||
$total_discounts = Tools::ps_round($total_discounts - $total_shipping, (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
|
|
||||||
$total_discounts_tax_exc = Tools::ps_round($total_discounts_tax_exc - $total_shipping_tax_exc, (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
|
|
||||||
|
|
||||||
// Update total shipping
|
// Update total shipping
|
||||||
$total_shipping = 0;
|
$total_shipping = 0;
|
||||||
$total_shipping_tax_exc = 0;
|
$total_shipping_tax_exc = 0;
|
||||||
|
|||||||
@@ -717,7 +717,7 @@ class CartRuleCore extends ObjectModel
|
|||||||
if ($this->free_shipping && ($filter == CartRule::FILTER_ACTION_ALL || $filter == CartRule::FILTER_ACTION_SHIPPING))
|
if ($this->free_shipping && ($filter == CartRule::FILTER_ACTION_ALL || $filter == CartRule::FILTER_ACTION_SHIPPING))
|
||||||
{
|
{
|
||||||
if (!$this->carrier_restriction)
|
if (!$this->carrier_restriction)
|
||||||
$reduction_value += $context->cart->getPackageShippingCost(is_null($package) ? null : $package['id_carrier'], $use_tax, $context->country, is_null($package) ? null : $package['products']);
|
$reduction_value += $context->cart->getOrderTotal($use_tax, Cart::ONLY_SHIPPING, is_null($package) ? null : $package['products'], is_null($package) ? null : $package['id_carrier']);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$data = Db::getInstance()->executeS('
|
$data = Db::getInstance()->executeS('
|
||||||
|
|||||||
Reference in New Issue
Block a user