[SOLVED][1.5] one more level of sub category!
57 posts
• Page 3 of 3 • 1, 2, 3
Re: [SOLVED][1.5] one more level of sub category!
can anyone build Vqmod version,,
i think will be usefull 
i think will be usefull 
-

dunks - Posts: 139
- Joined: Wed Apr 20, 2011 5:19 am
- Location: Jakarta - Indonesia
Re: [SOLVED][1.5] one more level of sub category!
In case anyone is trying to make this work for 1.5.2, this doesn't exactly work, but I made one minor modification after sifting through all the code, and it's merely another change in the stylesheet.css file.
Look for
Simply change to
Look for
- Code: Select all
.box-category > ul > li ul {
display: none;
}
Simply change to
- Code: Select all
.box-category > ul > li ul {
display: block;
}
- FlySpartan
- Posts: 1
- Joined: Wed Apr 04, 2012 3:18 am
-

xseon - Posts: 13
- Joined: Thu Dec 01, 2011 7:04 am
- Location: Bulgaria
Re: [SOLVED][1.5] one more level of sub category!
Any update for OC 1.5.3.1?
- devplus
- Posts: 18
- Joined: Fri May 18, 2012 3:43 pm
Re: [SOLVED][1.5] one more level of sub category!
pxdva wrote:Credit to the original poster chokoret for this post.
For 1.5.1.3 use the following:
STEP 1 Use this for catalog/controller/module/category.php:
- Code: Select all
<?php
class ControllerModuleCategory extends Controller {
protected function index() {
$this->language->load('module/category');
$this->data['heading_title'] = $this->language->get('heading_title');
if (isset($this->request->get['path'])) {
$parts = explode('_', (string)$this->request->get['path']);
} else {
$parts = array();
}
if (isset($parts[0])) {
$this->data['category_id'] = $parts[0];
} else {
$this->data['category_id'] = 0;
}
if (isset($parts[1])) {
$this->data['child_id'] = $parts[1];
} else {
$this->data['child_id'] = 0;
}
if (isset($parts[2])) {
$this->data['sisters_id'] = $parts[2];
} else {
$this->data['sisters_id'] = 0;
}
$this->load->model('catalog/category');
$this->load->model('catalog/product');
$this->data['categories'] = array();
$categories = $this->model_catalog_category->getCategories(0);
foreach ($categories as $category) {
$children_data = array();
$sister_data = array();
$children = $this->model_catalog_category->getCategories($category['category_id']);
foreach ($children as $child) {
$sister_data = array();
$sisters = $this->model_catalog_category->getCategories($child['category_id']);
if($sisters) {
foreach ($sisters as $sisterMember) {
$sister_data[] = array(
'category_id' =>$sisterMember['category_id'],
'name' => $sisterMember['name'],
'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id']. '_' . $sisterMember['category_id'])
);
}
$children_data[] = array(
'category_id' => $child['category_id'],
'sister_id' => $sister_data,
'name' => $child['name'],
'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])
);
}else{
$children_data[] = array(
'category_id' => $child['category_id'],
'sister_id' =>'',
'name' => $child['name'],
'href' => $this->url->link('product/category', 'path=' . $category['category_id'] . '_' . $child['category_id'])
);
}
}
$data = array(
'filter_category_id' => $category['category_id'],
'filter_sub_category' => true
);
$product_total = $this->model_catalog_product->getTotalProducts($data);
$this->data['categories'][] = array(
'category_id' => $category['category_id'],
'name' => $category['name'],
'children' => $children_data,
'sister' => $sister_data,
'href' => $this->url->link('product/category', 'path=' . $category['category_id'])
);
}
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/category.tpl')) {
$this->template = $this->config->get('config_template') . '/template/module/category.tpl';
} else {
$this->template = 'default/template/module/category.tpl';
}
$this->render();
}
}
?>
STEP 2: Use this for catalog/view/theme/default/template/module/category.tpl:
- Code: Select all
<div class="box">
<div class="box-heading"><?php echo $heading_title; ?></div>
<div class="box-content">
<div class="box-category">
<ul>
<?php foreach ($categories as $category) { ?>
<li>
<?php if ($category['category_id'] == $category_id) { ?>
<a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
<?php } else { ?>
<a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
<?php } ?>
<?php if ($category['children']) { ?>
<ul>
<?php foreach ($category['children'] as $child) { ?>
<li>
<?php if ($child['category_id'] == $child_id) { ?>
<a href="<?php echo $child['href']; ?>" class="active"> - <?php echo $child['name']; ?></a>
<?php } else { ?>
<a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a>
<?php } ?>
<?php if($child['sister_id']){ ?>
<ul>
<?php foreach($child['sister_id'] as $sisters) { ?>
<li>
<?php if ($sisters['category_id'] == $sisters_id) { ?>
<a href="<?php echo $sisters['href']; ?>" class="active"> - <?php echo $sisters['name']; ?></a>
<?php } else { ?>
<a href="<?php echo $sisters['href']; ?>"> - <?php echo $sisters['name']; ?></a>
<?php } ?>
</li>
<?php } ?>
</ul>
<?php } ?>
</li>
<?php } ?>
</ul>
<?php } ?>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
STEP 3:
FIND in catalog/view/theme/default/stylesheet/stylesheet.css
- Code: Select all
.box-category > ul > li ul > li > a.active + ul {
display: block;
}
and UNDER THAT, ADD:
- Code: Select all
.box-category > ul > li ul > li ul > li a.active {
font-weight: bold;
color: #06bcc3;
}
.box-category > ul > li ul > li ul > li a.active + ul {
display: block;
}
That worked for me using the default Opencart template.
perfect work with oc 1.5.3.1, except in show the sub sub sub.
eg:
- Code: Select all
Components
- Monitors
- test 1
-Sub 3 //This not show
- moscoiso
- Posts: 3
- Joined: Tue Jul 24, 2012 3:58 am
Re: [SOLVED][1.5] one more level of sub category!
Can somebody help in this:
i want to show category/sub-categories like
Hello 1 Hello 5 Hello 9
Hello 2 Hello 6 Hello 10
Hello 3 Hello 7 Hello 11
Hello 4 Hello 8 Hello 12
how to do that default style is
Hello1 Hello 2 Hello 3 Hello 4 Hello 5 Hello 6 Hello 7
Thanks
i want to show category/sub-categories like
Hello 1 Hello 5 Hello 9
Hello 2 Hello 6 Hello 10
Hello 3 Hello 7 Hello 11
Hello 4 Hello 8 Hello 12
how to do that default style is
Hello1 Hello 2 Hello 3 Hello 4 Hello 5 Hello 6 Hello 7
Thanks
- moxet
- Posts: 11
- Joined: Sat Jun 30, 2012 2:40 pm
one more level of sub category!
This is dead?
How to display the top menu?
How to display the top menu?
- moscoiso
- Posts: 3
- Joined: Tue Jul 24, 2012 3:58 am
Re: [SOLVED][1.5] one more level of sub category!
Hi all,, I have tried the earlier codes suggestions, and it works right to me,,..
But seems it that the number besides the category name was not now displayed after i have successfully followed the instructions...
How can be possible to display the number of items/products belongs to that category...
Currently, my sidebar categories displays like this:
Category Parent
- sub category a
- sub category b
- sub category c (
I want the result be like this:
Category Parent
- sub category a (10)
- sub category b (5)
- sub category c (15)
Please help..
Thanks
But seems it that the number besides the category name was not now displayed after i have successfully followed the instructions...
How can be possible to display the number of items/products belongs to that category...
Currently, my sidebar categories displays like this:
Category Parent
- sub category a
- sub category b
- sub category c (
I want the result be like this:
Category Parent
- sub category a (10)
- sub category b (5)
- sub category c (15)
Please help..
Thanks
- greensolef
- Posts: 41
- Joined: Tue Jul 03, 2012 6:20 am
Re: [SOLVED][1.5] one more level of sub category!
Please please help. 
I couldn't seem to find an answer to my specific error...
RE: SUBCATEGORY TITLES AND PRODUCTS NOT LISTING CORRECTLY/MISSING
Top category menu title is "Shop", under it I have subcategories "Vitamin-Rich Facial Serums", then "Fizzing Bath Bombs", then "Air Fresheners".
Now if you click on "Vitamin-Rich Facial Serums" it shows "Vitamin-Rich Facial Serums" title at the top and then shows all the products in that category, this is what is supposed to happen. BUT then other categories are NOT WORKING. If you click on "Fizzing Bath Bombs" the title on that page says "Shop" when it should say "Fizzing Bath Bombs" AND the products showing are from 2 different categories!!
Currently in the admin panel I have checked the box "shop" and "shop>fizzing bath bombs". Now if I uncheck "shop" no products show up in the "shop>fizzing bath bombs" checked box.
So to recap, it looks like there is something wrong in the categories admin panel. A problem with the title of the category missing from the page (not menu bar) and something wrong with the products combining together.
Here is my website link: http://www.skin-nv.com

I couldn't seem to find an answer to my specific error...
RE: SUBCATEGORY TITLES AND PRODUCTS NOT LISTING CORRECTLY/MISSING
Top category menu title is "Shop", under it I have subcategories "Vitamin-Rich Facial Serums", then "Fizzing Bath Bombs", then "Air Fresheners".
Now if you click on "Vitamin-Rich Facial Serums" it shows "Vitamin-Rich Facial Serums" title at the top and then shows all the products in that category, this is what is supposed to happen. BUT then other categories are NOT WORKING. If you click on "Fizzing Bath Bombs" the title on that page says "Shop" when it should say "Fizzing Bath Bombs" AND the products showing are from 2 different categories!!
Currently in the admin panel I have checked the box "shop" and "shop>fizzing bath bombs". Now if I uncheck "shop" no products show up in the "shop>fizzing bath bombs" checked box.
So to recap, it looks like there is something wrong in the categories admin panel. A problem with the title of the category missing from the page (not menu bar) and something wrong with the products combining together.
Here is my website link: http://www.skin-nv.com
- skinnv
- Posts: 5
- Joined: Tue Oct 11, 2011 9:15 pm
Re: [SOLVED][1.5] one more level of sub category!
Does anyone know how to make this work for 1.5.3.1? I've tried this and it doesn't seem to show the 3rd level category in the side category menu.
- jasonfleck
- Posts: 3
- Joined: Sun Sep 09, 2012 9:09 pm
Re: [SOLVED][1.5] one more level of sub category!
Hello Everyone,
I have got a template which supports 3 level menu ( as it is showing up in the html versioin of the template) but when i am trying to add 3 level ( that is sub sub category) it is not showing up.
Can anyone figure me out the real way to make sub sub category?
site is : www.levitechdisplays.com
Please answer fast as it is very urgent !
I have got a template which supports 3 level menu ( as it is showing up in the html versioin of the template) but when i am trying to add 3 level ( that is sub sub category) it is not showing up.
Can anyone figure me out the real way to make sub sub category?
site is : www.levitechdisplays.com
Please answer fast as it is very urgent !
- rajdeepr
- Posts: 1
- Joined: Fri Sep 14, 2012 4:55 am
Re: [SOLVED][1.5] one more level of sub category!
Does anyone knows how to apply this one for 1.5.4.1? for a custom theme?
- cosmicx
- Posts: 47
- Joined: Mon Jan 09, 2012 10:27 am
Re: [SOLVED][1.5] one more level of sub category!
cosmicx wrote:Does anyone knows how to apply this one for 1.5.4.1? for a custom theme?
Yes, anyone knows? Please?!
- dydyt
- Posts: 15
- Joined: Tue Oct 16, 2012 7:28 pm
Re: [SOLVED][1.5] one more level of sub category!
And for more levels??? 4, 5 ... Is it posible?????
Thanks.
Thanks.
- hispania
- Posts: 9
- Joined: Sat Oct 20, 2012 4:19 pm
Re: [SOLVED][1.5] one more level of sub category!
Any updates of this?
I really need to get more levels..
I really need to get more levels..
- Xciso
- Posts: 134
- Joined: Thu Jul 14, 2011 9:20 pm
Re: [SOLVED][1.5] one more level of sub category!
Does anyone know if this will work for version 1.5.4.1 or not?
- pgt_gaming
- Posts: 17
- Joined: Mon Jan 28, 2013 7:38 pm
Re: [SOLVED][1.5] one more level of sub category!
I have same problem. Funny, that it is working on the OC 1.4, but not on OC 1.5. 

- adriankoooo
- Posts: 146
- Joined: Wed Mar 02, 2011 10:52 pm
57 posts
• Page 3 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 18 guests
















