From 3fc24ec862a1fc30458abe755b42be2c242089dc Mon Sep 17 00:00:00 2001 From: dMetzger Date: Mon, 21 May 2012 14:29:54 +0000 Subject: [PATCH] // variable misnamed git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15513 b9a71923-0436-4b27-9f14-aed3839534dd --- 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); }