Answer the question
In order to leave comments, you need to log in
How to get all subcategories of Opencart?
How to teach all neighboring subcategories of this subcategory.
CMS opencart.
Answer the question
In order to leave comments, you need to log in
$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)
);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question