如何在opencart类别模块中显示多级下拉菜单?

时间:2015-09-07 10:01:38

标签: php opencart

我想在opencart 2.0类别模块中显示多级下拉菜单

Menu>submenu>submenu1>submenulevel2>level3>

1 个答案:

答案 0 :(得分:0)

您能否在管理区域或客户前端解释您是否需要这个?

category.tpl 的情况下,只需修改或写下这样的内容:

<?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 } ?>