Code: Select all
[1] => Array
(
[category_id] => 14308
[parent_id] => 14308
[level] => 0
)
[2] => Array
(
[category_id] => 179836
[parent_id] => 14308
[level] => 1
)
[3] => Array
(
[category_id] => 230022
[parent_id] => 179836
[level] => 2
)
This is what I have so far:
Code: Select all
$path_ids;
for ($i=0; $i <= ($category->CategoryLevel-1); $i++) {
// -1 cause the API returns a non zero-based level
$path_ids[$i]['category_id'] = $category->CategoryID;
if ($category->CategoryLevel-1 == $i) {
$path_ids[$i]['path_id'] = $category->CategoryParentID[0];
}
elseif ($category->CategoryLevel-1) {
// ?
}
$path_ids[$i]['level'] = $i;
}