$data['categories'] = array();
$results = $this->model_catalog_category->getCategories($category_id);
if (!$results && isset($this->request->get['path'])) {
$parts = explode('_', $this->request->get['path']);
$cur_id = array_pop($parts);
if (!empty($parts)) {
$results = $this->model_catalog_category->getCategories(array_pop($parts));
}
}
foreach ($results as $result) {
$filter_data = array(
'filter_category_id' => $result['category_id'],
'filter_sub_category' => true
);
$data['categories'][] = array(
'name' => $result['name'],
'category_id' => $result['category_id'],
'category_current' => isset($cur_id) && $cur_id ? $cur_id : false,
'href' => $this->url->link('product/category', 'path=' . $this->request->get['path'] . '_' . $result['category_id'] . $url)
);
}
Я внутри категории вот так выводил. Если нет дочерних - выводить соседние