Здравствуйте! Помогите решить проблему. Использую опенкарт 2.2 не могу создать новую родительскую категорию, при удалении старой категории остается пустое поле с ссылкой, при переходе попадаю на страницу категория не найдена и пишет ошибку
"PHP Notice: Undefined index: filter_groups in /home/h001278042/h001278042.nichost.ru/docs/catalog/controller/module/oclayerednavigation.php on line 115"
вот код отвечающий за это
if (isset($this->request->get['path'])) {
$parts = explode('_', (string)$this->request->get['path']);
} else {
$parts = array();
}
$category_id = end($parts);
$this->load->model('catalog/category');
$category_info = $this->model_catalog_category->getCategory($category_id);
$data = array();
if ($category_info) {
$this->load->language('module/oclayerednavigation');
$data['heading_title'] = $this->language->get('heading_title');
$data['button_filter'] = $this->language->get('button_filter');
$url = '';
if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}
if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}
if (isset($this->request->get['limit'])) {
$url .= '&limit=' . $this->request->get['limit'];
}
$data['action'] = str_replace('&', '&', $this->config->get('config_url') . 'index.php?route=module/oclayerednavigation/category&path=' . $category_id . $url);
$data['clear_action'] = str_replace('&', '&', $this->config->get('config_url') . 'index.php?route=module/oclayerednavigation/category&path=' . $category_id);
if (isset($this->request->get['filter'])) {
$data['filter_category'] = explode(',', $this->request->get['filter']);
} else {
$data['filter_category'] = array();
}
$this->load->model('catalog/product');
// Min price and Max price of product collection
/* Begin */
$min_price = 10000000; // Set the large number
$max_price = 0; // Set the small number
$data['products'] = array();
$filter_data = array(
'filter_category_id' => $category_id
);
$results = $this->model_catalog_product->getProducts($filter_data);
foreach($results as $result) {
$price = (float) $result['price'];
if($price < $min_price) {
$min_price = $price;
}
if($price > $max_price) {
$max_price = $price;
}
}
$data['min_price'] = $min_price;
$data['max_price'] = $max_price;
$data['currency_symbol'] = $this->currency->getSymbolLeft($this->session->data['currency']);
/* End */
$data['filter_groups'] = array();
$filter_groups = $this->model_catalog_category->getCategoryFilters($category_id);
if ($filter_groups) {
foreach ($filter_groups as $filter_group) {
$childen_data = array();
foreach ($filter_group['filter'] as $filter) {
$filter_data = array(
'filter_category_id' => $category_id,
'filter_filter' => $filter['filter_id']
);
$childen_data[] = array(
'filter_id' => $filter['filter_id'],
'name' => $filter['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''),
'e_name' => $filter['name']
);
}
$data['filter_groups'][] = array(
'filter_group_id' => $filter_group['filter_group_id'],
'name' => $filter_group['name'],
'filter' => $childen_data
);
}
}
}
if($data['filter_groups']) {
return $this->load->view('module/oclayerednavigation/oclayerednavigation.tpl', $data);
}
Подкатегории создаются, язык у магазина один, галочку ставлю для вывода на главный....
http://h001278042.nichost.ru/index.php?route=common/home ссылка на магазин