{#
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() %}
{% if app.request.get('_route') == 'product_list' or app.request.get('_route') == 'subsc_items' %}
{# 商品一覧ページの場合(ページ内遷移) #}
{% macro tree(Category) %}
{% from _self import tree %}
{% if app.request.get('_route') == 'product_list'%}
<a href="#cat_{{ Category.id }}"><i class="fas fa-chevron-down"></i>{{ ('front.block.category.list_text.id.' ~ Category.id)|trans }}</a>
{% else %}
<a href="#cat_{{ Category.id }}"><i class="fas fa-chevron-down"></i>{{ ('front.block.category.list_text.id.' ~ Category.id)|trans }}</a>
{% endif %}
{% if Category.children|length > 0 %}
<ul>
{% for ChildCategory in Category.children %}
<li>
{{ tree(ChildCategory) }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
{% from _self import tree %}
<div class="ec-categoryNaviRole">
<div class="ec-itemNav">
<ul class="ec-itemNav__nav">
{% for Category in Categories %}
<li>
{{ tree(Category) }}
</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}