diff --git a/classes/GroupReduction.php b/classes/GroupReduction.php index 599342844..e258d88fa 100644 --- a/classes/GroupReduction.php +++ b/classes/GroupReduction.php @@ -137,6 +137,7 @@ class GroupReductionCore extends ObjectModel SELECT `reduction` FROM `'._DB_PREFIX_.'product_group_reduction_cache` WHERE `id_product` = '.(int)$id_product.' AND `id_group` = '.(int)$id_group); + // Should return string (decimal in database) and not a float return self::$reduction_cache[$id_product.'-'.$id_group]; } diff --git a/classes/Product.php b/classes/Product.php index b43e19015..26626c033 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -2720,8 +2720,7 @@ class ProductCore extends ObjectModel if ($use_group_reduction) { $reduction_from_category = GroupReduction::getValueForProduct($id_product, $id_group); - - if (!empty($reduction_from_category) && (float)$reduction_from_category == 0) + if ($reduction_from_category !== false) $price -= $price * (float)$reduction_from_category; else // apply group reduction if there is no group reduction for this category $price *= ((100 - Group::getReductionByIdGroup($id_group)) / 100);