app/template/default/Block/category_nav_sp.twig line 1

Open in your IDE?
  1. {#
    This file is part of EC-CUBE
    
    Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
    
    http://www.ec-cube.co.jp/
    
    For the full copyright and license information, please view the LICENSE
    file that was distributed with this source code.
    #}
    {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
    
    {% macro tree(Category) %}
        {% from _self import tree %}
        <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
            {{ Category.name }}
        </a>
        {% if Category.children|length > 0 %}
            <ul>
                {% for ChildCategory in Category.children %}
                    <li>
                        {{ tree(ChildCategory) }}
                    </li>
                {% endfor %}
            </ul>
        {% endif %}
    {% endmacro %}
    
    {# @see https://github.com/bolt/bolt/pull/2388 #}
    {% from _self import tree %}
    
    <div class="ec-headerLinkArea">
        <div class="ec-headerLink__list">
            <a class="ec-headerLink__item" href="{{ url(eccube_config.eccube_user_data_route, {'route': 'flow'}) }}">
                <div class="ec-headerLink__icon">
                    <i class="fas fa-book fa-fw"></i>
                </div>
                <span>{{ 'お取引ガイド'|trans }}</span>
            </a>
        </div>
        <div class="ec-headerLink__list">
            <a class="ec-headerLink__item" href="{{ url(eccube_config.eccube_user_data_route, {'route': 'introduction'}) }}">
                <div class="ec-headerLink__icon">
                    <i class="fas fa-lightbulb fa-fw"></i>
                </div>
                <span>{{ '会員登録のメリット'|trans }}</span>
            </a>
        </div>
    </div>
    <div class="ec-headerCategoryArea">
        <div class="ec-headerCategoryArea__heading">
            <p>{{ 'カテゴリ一覧'|trans }}</p>
        </div>
        <div class="ec-itemNav">
            <ul class="ec-itemNav__nav">
                {% for ProCategory in Categories %}
                    {% if ProCategory.id == 1 %}
                        <li>
                            <a href="{{ url('product_list') }}">{{ '商品一覧'|trans }}</a>
                        </li>
                        {% for Category in ProCategory.children %}
                            <li>
                                {{ tree(Category) }}
                            </li>
                        {% endfor %}
                    {% endif %}
                {% endfor %}
            </ul>
        </div>
    </div>