From cab8b2b251df1fd7caf7bde2c60ac31e3ad514ca Mon Sep 17 00:00:00 2001 From: mDeflotte Date: Fri, 13 Jul 2012 12:35:52 +0000 Subject: [PATCH] [-] BO : #PSCFV-3192 - Product::getAttributeGroups return duplicated attributes // Fix little bug git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16411 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Product.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/Product.php b/classes/Product.php index 42a50222a..276b4c083 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -2481,7 +2481,7 @@ class ProductCore extends ObjectModel if (is_array($result) && (!$specific_price || !$specific_price['id_product_attribute'])) { $attribute_price = Tools::convertPrice($result['attribute_price'] !== null ? (float)$result['attribute_price'] : 0, $id_currency); - if ($id_product_attribute !== false) // If you want the default combination, please use NULL value instead + if ($id_product_attribute !== false && !is_null($id_product_attribute)) // If you want the default combination, please use NULL value instead $price += $attribute_price; } @@ -2847,6 +2847,7 @@ class ProductCore extends ObjectModel WHERE pa.`id_product` = '.(int)$this->id.' AND al.`id_lang` = '.(int)$id_lang.' AND agl.`id_lang` = '.(int)$id_lang.' + GROUP BY a.id_attribute ORDER BY ag.`position` ASC, a.`position` ASC'; return Db::getInstance()->executeS($sql); }