// fixed bug on category count

This commit is contained in:
sThiebaut committed 2011-12-05 16:52:27 +00:00
1 parent 11a180175c
commit da881e8e17
1 file changed
+1 -2
+1 -2
View File
@@ -594,8 +594,7 @@ class CategoryCore extends ObjectModel
LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product` LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON p.`id_product` = cp.`id_product`
WHERE cp.`id_category` = '.(int)$this->id. WHERE cp.`id_category` = '.(int)$this->id.
($active ? ' AND p.`active` = 1' : ''). ($active ? ' AND p.`active` = 1' : '').
($id_supplier ? 'AND p.id_supplier = '.(int)$id_supplier : ''). ($id_supplier ? 'AND p.id_supplier = '.(int)$id_supplier : '');
' GROUP BY p.id_product';
return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
} }