{#
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() %}
{% set CategoriesCount = repository('Eccube\\Entity\\Product').findProductsWithCategoriesCount() %}
{% set Makers = repository('Plugin\\Maker42\\Entity\\Maker').findBy({}, {sort_no: 'desc' }, 5) %}
{% macro tree(Category, CategoriesCount) %}
{% from _self import tree %}
<a class="fs-6 js-category-link-sp" href="{{ url('product_list') }}?category_id={{ Category.id }}">
{% if (Category.Parent == "") %}
<img class="menu-icon me-2" src="/html/user_data/assets/img/category/{{ Category.id }}.png" alt="{{ Category.name }}">
{% endif %}
{{ Category.name }}{% if CategoriesCount[Category.id] is defined %} ({{CategoriesCount[Category.id]|number_format}}){% else %} (0){% endif %}
</a>
{% if Category.children|length > 0 %}
<ul>
{% for ChildCategory in Category.children %}
<li>
{{ tree(ChildCategory, CategoriesCount) }}
</li>
{% endfor %}
</ul>
{% endif %}
{% endmacro %}
{# @see https://github.com/bolt/bolt/pull/2388 #}
{% from _self import tree %}
<div class="ec-headerCategoryArea">
<div class="ec-headerCategoryArea__heading">
<p>{{ 'カテゴリ一覧'|trans }}</p>
</div>
<div class="ec-itemNav">
<ul class="ec-itemNav__nav">
{% for Category in Categories %}
<li>
{{ tree(Category, CategoriesCount) }}
</li>
{% endfor %}
</ul>
</div>
<div class="ec-headerCategoryArea__heading">
<p>{{ 'メーカー一覧'|trans }}</p>
</div>
<div class="ec-itemNav maker_list">
<ul class="ec-itemNav__nav">
{% for Maker in Makers %}
<li><a class='fs-6' href="{{ url('product_list') }}?maker_id={{ Maker.id }}">{{ Maker.name }}</a></li>
{% endfor %}
</ul>
<div class='py-2 px-2'>
<a href="{{ url('maker') }}"><button class='metroFamilyOrder-button01' type='button'>一覧を見る</button></a>
</div>
</div>
</div>