Page 3 of 4

Re: [SOLVED][1.5] one more level of sub category!

Posted: Sat Mar 31, 2012 2:10 pm
by dunks
can anyone build Vqmod version,, ;D i think will be usefull O0

Re: [SOLVED][1.5] one more level of sub category!

Posted: Wed Apr 04, 2012 11:21 am
by FlySpartan
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

Code: Select all

.box-category > ul > li ul {
	display: none;
}
Simply change to

Code: Select all

.box-category > ul > li ul {
	display: block;
}

Re: [SOLVED][1.5] one more level of sub category!

Posted: Sat Apr 07, 2012 4:10 am
by xseon

Re: [SOLVED][1.5] one more level of sub category!

Posted: Wed Jun 06, 2012 11:07 pm
by devplus
Any update for OC 1.5.3.1?

Re: [SOLVED][1.5] one more level of sub category!

Posted: Tue Jul 24, 2012 12:17 pm
by moscoiso
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

Re: [SOLVED][1.5] one more level of sub category!

Posted: Sat Aug 04, 2012 7:58 pm
by moxet
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

one more level of sub category!

Posted: Sat Aug 18, 2012 4:50 am
by moscoiso
This is dead? :'(
How to display the top menu?

Re: [SOLVED][1.5] one more level of sub category!

Posted: Fri Aug 24, 2012 1:27 pm
by greensolef
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

Re: [SOLVED][1.5] one more level of sub category!

Posted: Tue Sep 04, 2012 7:15 am
by skinnv
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

Re: [SOLVED][1.5] one more level of sub category!

Posted: Mon Sep 10, 2012 5:10 am
by jasonfleck
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.

Re: [SOLVED][1.5] one more level of sub category!

Posted: Fri Sep 14, 2012 1:23 pm
by rajdeepr
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 !

Re: [SOLVED][1.5] one more level of sub category!

Posted: Mon Sep 17, 2012 2:39 am
by cosmicx
Does anyone knows how to apply this one for 1.5.4.1? for a custom theme?

Re: [SOLVED][1.5] one more level of sub category!

Posted: Thu Oct 25, 2012 7:50 pm
by dydyt
cosmicx wrote:Does anyone knows how to apply this one for 1.5.4.1? for a custom theme?
Yes, anyone knows? Please?!

Re: [SOLVED][1.5] one more level of sub category!

Posted: Thu Oct 25, 2012 11:11 pm
by hispania
And for more levels??? 4, 5 ... Is it posible?????

Thanks.

Re: [SOLVED][1.5] one more level of sub category!

Posted: Fri Jan 04, 2013 8:46 pm
by Xciso
Any updates of this?
I really need to get more levels..

Re: [SOLVED][1.5] one more level of sub category!

Posted: Wed Jan 30, 2013 11:01 am
by pgt_gaming
Does anyone know if this will work for version 1.5.4.1 or not?

Re: [SOLVED][1.5] one more level of sub category!

Posted: Sat Feb 02, 2013 5:11 pm
by adriankoooo
I have same problem. Funny, that it is working on the OC 1.4, but not on OC 1.5. :-\

Re: [SOLVED][1.5] one more level of sub category!

Posted: Fri Jul 26, 2013 10:54 am
by halohalobiz
Is this the solution for the Left Side Bar Menu Sub and Subcategory?


or do you have a tweak for the sub category to appear.

See my link: http://i.imgur.com/D4oFvy4.jpg

only the Men and Women appear even if i have Sub Categories for Dresses and under Dresses i have Lingerie but it doesn't appear there. I used Opencart 1.5.5.1

Re: [SOLVED][1.5] one more level of sub category!

Posted: Sat Aug 03, 2013 9:53 pm
by phpMagpie
Here's a vqmod for 1.5.5.1 to add a 3rd level to the category module.

HTH, Paul

Re: [SOLVED][1.5] one more level of sub category!

Posted: Fri Oct 11, 2013 2:25 am
by stamasar
v1.5.6
Works great if you navigate using the categories module. But it won`t work if you navigate from the header menu.
It looks like the header menu doesn`t keep the full URL for the Category > SubCategory > SubSubCategory.
Instead of this i get SubCategory > SubSubCategory..

For example if i use the category module the path (correctly) is:
route=product/category&path=57_60_69

If i navigate from the header menu i get:
route=product/category&path=60_69 (the main category is missing so the path is not well structured.)

Any suggestions?

Thanks
Stam