From 126df4663d3e3d904e98ebf67cc9dadecf3e76f0 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Wed, 17 Oct 2012 07:16:35 +0000 Subject: [PATCH] // Fix bug wen i install --- classes/GroupReduction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/GroupReduction.php b/classes/GroupReduction.php index 3d4edf9b2..4e082f3e7 100644 --- a/classes/GroupReduction.php +++ b/classes/GroupReduction.php @@ -189,11 +189,11 @@ class GroupReductionCore extends ObjectModel public static function setProductReduction($id_product, $id_group = null, $id_category, $reduction = null) { + $res = true; GroupReduction::deleteProductReduction((int)$id_product); $reductions = GroupReduction::getGroupsByCategoryId((int)$id_category); if ($reductions) { - $res = true; foreach ($reductions as $reduction) $res &= Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES ('.(int)$id_product.', '.(int)$reduction['id_group'].', '.(float)$reduction['reduction'].')');