// variable misnamed
This commit is contained in:
+7
-3
@@ -1458,7 +1458,7 @@ class CartCore extends ObjectModel
|
||||
if (is_null($products))
|
||||
$in_order = true;
|
||||
else
|
||||
foreach ($products as $products)
|
||||
foreach ($products as $product)
|
||||
if ($cart_rule['obj']->gift_product == $product['id_product'] && $cart_rule['obj']->gift_product_attribute = $product['id_product_attribute'])
|
||||
$in_order = true;
|
||||
|
||||
@@ -1469,8 +1469,12 @@ class CartCore extends ObjectModel
|
||||
// If the cart rule offers a reduction, the amount is prorated (with the products in the package)
|
||||
if ($cart_rule['obj']->reduction_percent > 0 || $cart_rule['obj']->reduction_amount > 0)
|
||||
{
|
||||
$id_address_delivery = ((is_null($products) || !isset($products[0])) ? $this->id_address_delivery : $products[0]['id_address_delivery']);
|
||||
$package = array('id_address' => $id_address_delivery, 'products' => $products);
|
||||
$package = null;
|
||||
if (!is_null($products))
|
||||
{
|
||||
$id_address_delivery = (is_null($products) ? $this->id_address_delivery : $products[0]['id_address_delivery']);
|
||||
$package = array('id_address' => $id_address_delivery, 'products' => $products);
|
||||
}
|
||||
$order_total_discount += Tools::ps_round($cart_rule['obj']->getContextualValue($with_taxes, $virtual_context, CartRule::FILTER_ACTION_REDUCTION, $package), 2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user