Multi-Level Categories (category module)

  • Mtspinto
  • Mtspinto's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
1 month 6 hours ago - 1 month 6 hours ago #132735 by Mtspinto
Evening team. I have been able to create categories and sub categories with ease • multi•level.

But my module on the left doesn't show the 3rd level of sub•categories

so instead of

maincat (25)
•••• subcat A (5)
•••• subcat B (5)
•••• subcat C (10)
•••••••••• subcat C0 (3)
•••••••••• subcat C1 (2)
•••••••••• subcat C2 (2)
•••••••••• subcat C3 (3)
•••• subcat D (5)
maincat 2(8)
•••• subcat A (5).....

it displays as:

maincat 1(25)
•••• subcat A (5)
•••• subcat B (5)
•••• subcat C (10)
•••• subcat D (5)
maincat 2(8)
•••• subcat A (5).....

I looked at: mod_eshop_category/tmpl/default.php but cannot find where to add another "child category code" so I can see my third level. Please help me add it in

The css has already been changed in "custom.css" so I could see all the sub categories seeing that there isn't a lot
<?php
  if ($showChildren && $category•>childCategories)
  {
  ?>
    <ul>
    <?php
    foreach ($category•>childCategories as $childCategory)
    {
      if ($showNumberProducts)
      {
        $numberProducts = ' (' . EshopHelper::getNumCategoryProducts($childCategory•>id, true) . ')';
      }
      else
      {
        $numberProducts = '';
      }
      ?>
      <li>
        <?php
        $active = $childCategory•>id == $childCategoryId ? 'class="active"' : '';
        ?>
        <a href="<?php echo JRoute::_(EshopRoute::getCategoryRoute($childCategory•>id)); ?>" <?php echo $active; ?>> • <?php echo $childCategory•>category_name . $numberProducts; ?></a>
      </li>
    <?php
    }
    ?>
    </ul>
  <?php
  }
  ?>
Last edit: 1 month 6 hours ago by Mtspinto. Reason: lists formatted incorrectly

Please Log in or Create an account to join the conversation.

  • Mtspinto
  • Mtspinto's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
2 weeks 6 days ago #132998 by Mtspinto
Replied by Mtspinto on topic Multi-Level Categories (category module)
Hi there.

Please help me add the code to show the 3rd level of sub-categories.

Please Log in or Create an account to join the conversation.

Moderators: Giang Dinh Truong