From 82a230aa7003aa60f22bcaa3d55558d45328d565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Tue, 11 Dec 2012 17:45:06 +0100 Subject: [PATCH] [-] Core: Fix #PSCFV-5997 - Product::priceCalculation not return the price of default combination --- classes/Product.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/classes/Product.php b/classes/Product.php index f7b1715a1..ca3082963 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -244,7 +244,7 @@ class ProductCore extends ObjectModel 'multilang' => true, 'multilang_shop' => true, 'fields' => array( - // Classic fields + /* Classic fields */ 'id_shop_default' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_manufacturer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'id_supplier' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), @@ -2604,7 +2604,8 @@ class ProductCore extends ObjectModel if (is_array($result) && (!$specific_price || !$specific_price['id_product_attribute'] || $specific_price['price'] < 0)) { $attribute_price = Tools::convertPrice($result['attribute_price'] !== null ? (float)$result['attribute_price'] : 0, $id_currency); - if ($id_product_attribute !== false && !is_null($id_product_attribute)) // If you want the default combination, please use NULL value instead + // If you want the default combination, please use NULL value instead + if ($id_product_attribute !== false) $price += $attribute_price; }