定制 monsieurbiz/mbiz_menu 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

monsieurbiz/mbiz_menu

Composer 安装命令:

composer require monsieurbiz/mbiz_menu

包简介

Magento module which gives a better menu block.

README 文档

README

Mbiz_Menu is a Magento 1 module which provides an optimized menu as a simple block.

Usage

The block mbiz_menu/page_html_topmenu gives 2 methods:

  1. getCategoriesTree() which returns main categories with children. Children are available using the method $cat->get_children().
  2. getCategories which returns all the categories available in the menu.

Each category has 2 new data available:

  • contains_current_category is set to true if the category has the current category in its children.
  • is_current_category is set to true if the category is the actual current one.

Example

No template is provided. But here is an really simple example:

<?php
/* @var $this Mbiz_Menu_Block_Page_Html_Topmenu */
$_tree   = $this->getCategoriesTree();
$_output = $this->helper('catalog/output');
?>
<ul>
<?php foreach ($_tree as $_mainCategory): ?>
    <li class="<?php if ($_mainCategory->getIsCurrentCategory() || $_mainCategory->getContainsCurrentCategory()): ?>active<?php endif; ?>">
        <a href="<?php echo $_mainCategory->getUrl(); ?>">
            <?php echo $_output->categoryAttribute($_mainCategory, $_mainCategory->getName(), 'name'); ?>
        </a>
        <?php if ($_children = $_mainCategory->get_children()): ?>
        <ul>
            <?php foreach ($_children as $_child): ?>
            <li class="<?php if ($_child->getIsCurrentCategory()): ?>current<?php endif; ?>">
                <a href="<?php echo $_child->getUrl(); ?>">
                    <?php echo $_output->categoryAttribute($_child, $_child->getName(), 'name'); ?>
                </a>
            </li>
            <?php endforeach; ?>
        </ul>
        <?php endif; ?>
    </li>
<?php endforeach; ?>
</ul>

By default the block uses a 72 hours cache lifetime. Of course the default value can be overrided.

统计信息

  • 总下载量: 400
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 5
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2016-08-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固