foreach ($categories as $category) { if ($category['top']) { // Level 2 $children_data = array(); $children = $this->model_catalog_category->getCategories($category['category_id']); // lvl 3 category foreach ($children as $child) { $children_data2 = array(); $children2 = $this->model_catalog_category->getCategories($child['category_id']); foreach ($children2 as $child2) { $children_data2[] = array( 'name' => $child2['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $child['category_id'] . '_' . $child2['category_id']), ); } $filter_data = array( 'filter_category_id' => $child['category_id'], 'filter_sub_category' => true ); $children_data[] = array( 'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']), 'children' => $children_data2, ); } // lvl 3 category 'name' => $sub_child['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($sub_filter_data) . ')' : ''), 'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'] . '_' . $sub_child['category_id']) ); } $filter_data = array( 'filter_category_id' => $child['category_id'], 'filter_sub_category' => true ); $children_data[] = array( 'name' => $child['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''), 'children' => $sub_children_data, 'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']) ); } // Level 1 $data['categories'][] = array( 'name' => $category['name'], 'image' => 'image/'.$category['image'], 'children' => $children_data, 'column' => $category['column'] ? $category['column'] : 1, 'href' => $this->url->link('product/category', 'path=' . $category['category_id']) ); } }
Fatal error: Uncaught Error: Class 'Controllercommonmenu' not found in /home/users/9/9252047376/domains/storage/modification/system/engine/action.php:71 Stack trace: #0 /home/users/9/9252047376/domains/storage/modification/system/engine/loader.php(48): Action->execute(Object(Registry), Array) #1 /home/users/9/9252047376/domains/santexyam.ru/catalog/controller/common/header.php(102): Loader->controller('common/menu') #2 /home/users/9/9252047376/domains/storage/modification/system/engine/action.php(79): ControllerCommonHeader->index(Array) #3 /home/users/9/9252047376/domains/storage/modification/system/engine/loader.php(48): Action->execute(Object(Registry), Array) #4 /home/users/9/9252047376/domains/santexyam.ru/catalog/controller/common/maintenance.php(25): Loader->controller('common/header') #5 /home/users/9/9252047376/domains/storage/modification/system/engine/action.php(79): ControllerCommonMaintenance->index() #6 /home/users/9/9252047376/domains/santexyam.ru/system/engine/router.php(67): Action->execute(Object(Registr in /home/users/9/9252047376/domains/storage/modification/system/engine/action.php on line 71