// Categories Tree changes

This commit is contained in:
Jerome Nadaud
2013-09-10 18:40:05 +02:00
parent 1aba28ff6f
commit e0d33eae9e
14 changed files with 128 additions and 216 deletions
+3 -3
View File
@@ -477,11 +477,11 @@ class CategoryCore extends ObjectModel
return $categories;
}
public static function getNestedCategories($parent_category = 0,
public static function getNestedCategories($root_category = 1,
$id_lang = false, $active = true, $sql_filter = '', $sql_sort = '',
$sql_limit = '')
{
if (!Validate::isInt($parent_category))
if (!Validate::isInt($root_category))
die(Tools::displayError());
if (!Validate::isBool($active))
@@ -506,7 +506,7 @@ class CategoryCore extends ObjectModel
$current = &$buff[$row['id_category']];
$current = $row;
if ($row['id_parent'] == $parent_category)
if ($row['id_category'] == $root_category)
$categories[$row['id_category']] = &$current;
else
$buff[$row['id_parent']]['children'][$row['id_category']] = &$current;