{#
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() %}
{# 非表示にするカテゴリ ID:
21=DIY材料 / 28=石材 / 44=照明 (非表示要件)
34=ベランダ・バルコニー (親 cat=19 と同名で階層 2 段になるため子は非表示) #}
{% set HIDDEN_CATEGORY_IDS = [21, 28, 44, 34] %}
{% macro tree(Category, HIDDEN_CATEGORY_IDS) %}
{% from _self import tree %}
{% if Category.id not in HIDDEN_CATEGORY_IDS %}
<a href="{{ url('product_list') }}?category_id={{ Category.id }}">
{{ Category.name }}
</a>
{% if Category.children|length > 0 %}
<ul>
{% for ChildCategory in Category.children %}
{% if ChildCategory.id not in HIDDEN_CATEGORY_IDS %}
<li>
{{ tree(ChildCategory, HIDDEN_CATEGORY_IDS) }}
</li>
{% endif %}
{% endfor %}
</ul>
{% endif %}
{% 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 %}
{% if Category.id == 26 %}
{# 'その他' (cat=26) is a grouping-only parent. The PC header
(commit 7300adb7) replaced the single 'その他' entry with its
child categories as direct items so customers don't have to
drill in. Mirror that on SP: surface cat=26's non-hidden
children at the top level instead of nesting them under
'その他'. getList() orders each level by sort_no DESC, so the
resulting order (パーゴラ / 立水栓 / 手すり / ストックヤード /
ゴミステーション / 面格子 / 窓シャッター / 玄関ドア) matches
the PC header. #}
{% for ChildCategory in Category.children %}
{% if ChildCategory.id not in HIDDEN_CATEGORY_IDS %}
<li>
{{ tree(ChildCategory, HIDDEN_CATEGORY_IDS) }}
</li>
{% endif %}
{% endfor %}
{% elseif Category.id not in HIDDEN_CATEGORY_IDS %}
<li>
{{ tree(Category, HIDDEN_CATEGORY_IDS) }}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
<div class="ec-headerCategoryArea">
<div class="ec-headerCategoryArea__heading">
<p>{{ 'ブランドから探す'|trans }}</p>
</div>
<div class="ec-itemNav">
<ul class="ec-itemNav__nav">
<li><a href="#">LIXIL</a></li>
<li><a href="#">YKK AP</a></li>
<li><a href="#">三協アルミ</a></li>
<li><a href="#">四国化成</a></li>
<li><a href="#">タカショー</a></li>
<li><a href="#">パナソニック</a></li>
<li><a href="#">イナバ</a></li>
<li><a href="#">ヨドコウ</a></li>
<li><a href="#">ユニソン</a></li>
<li><a href="#">エスビック</a></li>
</ul>
</div>
</div>