From 9b092be840a9cf78f04220e8b96ee9b2d1b2e87f Mon Sep 17 00:00:00 2001 From: dMetzger Date: Mon, 21 May 2012 14:29:54 +0000 Subject: [PATCH] // variable misnamed --- classes/Cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/Cart.php b/classes/Cart.php index 88d6fd3e4..32a485c40 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -1469,7 +1469,7 @@ 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) ? $this->id_address_delivery : $products[0]['id_address_delivery']); + $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); $order_total_discount += Tools::ps_round($cart_rule['obj']->getContextualValue($with_taxes, $virtual_context, CartRule::FILTER_ACTION_REDUCTION, $package), 2); }