From f1b7e0b8345f6b08e53b1dd446fd45b63024f889 Mon Sep 17 00:00:00 2001 From: dMetzger Date: Mon, 21 May 2012 18:56:19 +0000 Subject: [PATCH] // Fixed warning when calculating the order total of an empty cart git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15575 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Cart.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index bc6da9cde..ac87f21c7 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -1443,8 +1443,10 @@ class CartCore extends ObjectModel $cart_rules[] = $tmp_cart_rule; } } - - $id_address_delivery = (is_null($products) ? $this->id_address_delivery : $products[0]['id_address_delivery']); + + $id_address_delivery = 0; + if (isset($products[0])) + $id_address_delivery = (is_null($products) ? $this->id_address_delivery : $products[0]['id_address_delivery']); $package = array('id_carrier' => $id_carrier, 'id_address' => $id_address_delivery, 'products' => $products); // Then, calculate the contextual value for each one