opencart 2.3
theme-default
I am New to opencart. I Just want to show all Category & Sub- Categories in every page of my web site as it is in sitemap page ,already tried to edit code in /catalog/controller/extension/module/category.php and also in \catalog\view\theme\default\template\extension\module\category.tpl ,but nothing seems to work for me.
theme-default
I am New to opencart. I Just want to show all Category & Sub- Categories in every page of my web site as it is in sitemap page ,already tried to edit code in /catalog/controller/extension/module/category.php and also in \catalog\view\theme\default\template\extension\module\category.tpl ,but nothing seems to work for me.
I want to use category module ,but with some changes . For example ` i have three level deep categories
structure (as it's shown on picture 1.jpg).
So ,i want the categories module to show all the categories and subcategories in the same way as it's in sitemap page(index.php?route=information/sitemap) (as it's shown on picture 2.jpg).
i have already tried to edit catalog/controller/extension/module/category.php (maybe the problem is in foreach loop) and also catalog/view/theme/default/template/extension/module/category.tpl ,but nothing really seems to work for me...
p.s. Thank you in advance
structure (as it's shown on picture 1.jpg).
So ,i want the categories module to show all the categories and subcategories in the same way as it's in sitemap page(index.php?route=information/sitemap) (as it's shown on picture 2.jpg).
i have already tried to edit catalog/controller/extension/module/category.php (maybe the problem is in foreach loop) and also catalog/view/theme/default/template/extension/module/category.tpl ,but nothing really seems to work for me...

p.s. Thank you in advance

Attachments
2.jpg (95.22 KiB) Viewed 1992 times
1.jpg (61.31 KiB) Viewed 1992 times
Unfortunately ,no .This is still unsolved problem.Really can't find the right solution.
Maybe ,as i should use the same code from sitemap for creating module,it would be easier to edit the default category.php file then creating separete module
i wonder ,maybe the problem is in this part of code ??
( \catalog\controller\extension\module\category.php from line 34 )
Please help 
Maybe ,as i should use the same code from sitemap for creating module,it would be easier to edit the default category.php file then creating separete module

i wonder ,maybe the problem is in this part of code ??
( \catalog\controller\extension\module\category.php from line 34 )
Code: Select all
foreach ($categories as $category) {
$children_data = array();
if ($category['category_id'] == $data['category_id']) {
$children = $this->model_catalog_category->getCategories($category['category_id']);
foreach($children as $child) {
$filter_data = array('filter_category_id' => $child['category_id'], 'filter_sub_category' => true);
$children_data[] = array(
'category_id' => $child['category_id'],
'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'])
);
}
}
$filter_data = array(
'filter_category_id' => $category['category_id'],
'filter_sub_category' => true
);
$data['categories'][] = array(
'category_id' => $category['category_id'],
'name' => $category['name'] . ($this->config->get('config_product_count') ? ' (' . $this->model_catalog_product->getTotalProducts($filter_data) . ')' : ''),
'children' => $children_data,
'href' => $this->url->link('product/category', 'path=' . $category['category_id'])
);
}

Who is online
Users browsing this forum: No registered users and 5 guests