简体   繁体   English

如何在opencart的左侧创建类别和子类别?

[英]How to create categories and sub-categories in left side in opencart?

I am beginner in open-cart .I currently working in web2print extension in open-cart.I need to create categories and sub categories in left side.I already display categories menu in left side via admin panel,but i need to create display categories and sub-categories in left side bar with similar manner. 我是open-cart初学者。我目前在open-cart web2print扩展中工作。我需要在左侧创建类别和子类别。我已经通过管理面板在左侧显示了类别菜单,但是我需要创建显示类别和左侧栏中的子类别。

 <div class="box clsLeft_menu">
  <div class="box-heading">Some of our specialties:</div>
  <div class="box-content">
    <ul class="box-category">
      <?php foreach ($categories as $category) { ?>
      <li>
        <?php if ($category['category_id'] == $category_id) { ?>
        <a href="<?php echo $category['href']; ?>" class="active"><?php echo $category['name']; ?></a>
        <?php } else { ?>
        <a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
        <?php } ?>
        <?php if ($category['children']) { ?>
        <ul>
          <?php foreach ($category['children'] as $child) { ?>
          <li>
            <?php if ($child['category_id'] == $child_id) { ?>
            <a href="<?php echo $child['href']; ?>" class="active"> - <?php echo $child['name']; ?></a>
            <?php } else { ?>
            <a href="<?php echo $child['href']; ?>"> - <?php echo $child['name']; ?></a>
            <?php } ?>
          </li>
          <?php } ?>
        </ul>
        <?php } ?>
      </li>
      <?php } ?>
    </ul>
  </div>
</div>

I want to display categories and sub-categories in opencart. 我想在opencart中显示类别和子类别。 example: 例:

--main categories -主要类别

--sub 1
--sub 2
--sub 3  

--main categories -主要类别

--sub 1
--sub 2

how to solve it ?Please guide me... 如何解决?请指导我...

Search for vertical accordion menu. 搜索垂直手风琴菜单。 There are plenty of plugins available, though not directly for opencart, can be easily added. 有很多可用的插件,尽管不是直接用于opencart,但可以轻松添加。

Couple of example: 几个例子:

http://visionwidget.com/jquery-accordion-slider-menu.html http://visionwidget.com/jquery-accordion-slider-menu.html

http://www.designchemical.com/blog/index.php/jquery/jquery-tutorial-create-a-jquery-menu-slider/ http://www.designchemical.com/blog/index.php/jquery/jquery-tutorial-create-a-jquery-menu-slider/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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