简体   繁体   中英

How to show multilevel dropdown menu in opencart category module?

我想在opencart 2.0类别模块中显示Multilevel Dropdown菜单

Menu>submenu>submenu1>submenulevel2>level3>

Can you please explain if you want this in the Admin area or the customer front end?

In which case in category.tpl just modify or write something like this:

<?php if ($categories) { ?>
               <?php if (count($categories) <= 5) { ?>
                 <div class="col-sm-3 nosidepadding">
                   <ul>
                     <?php foreach ($categories as $category) { ?>
                     <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
                     <?php } ?>
                   </ul>
                 </div>
               <?php } else { ?>
               <?php foreach (array_chunk($categories, ceil(count($categories) / 4)) as $categories) { ?>
                 <div class="col-sm-3 nosidepadding">
                   <ul>
                     <?php foreach ($categories as $category) { ?>
                     <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a></li>
                     <?php } ?>
                   </ul>
                 </div>
               <?php } ?>
               <?php } ?>
               <?php } ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM