2015-09-07 77 views

回答

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

我需要這在前端....對於Opencart的2.0,你可以分享的東西.. – avktech

+0

這是OC.20 – TheBlackBenzKid