我想在opencart 2.0类别模块中显示多级下拉菜单
Menu>submenu>submenu1>submenulevel2>level3>
答案 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 } ?>