{#
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 start_date = '2021-09-06'|date('Y-m-d') %}
{% set end_date = '2021-09-27'|date('Y-m-d') %}
{% set sale_category_id = 174 %}
{% if start_date <= date()|date('Y-m-d') and date()|date('Y-m-d') <= end_date %}
{% set campaign_valid = true %}
{% else %}
{% set campaign_valid = false %}
{% endif %}
<style>
@media only screen and (min-width: 769px){
ul.ec-itemNav__nav {
display: flex!important;
justify-content: space-between!important;
padding: 0px;
}
ul.ec-itemNav__nav li a{
padding: 12px!important;
margin-left: 0px!important;
height: auto;
}
.item_subcategory ul{
margin-top: 0px!important;
margin-left: -5px!important;
}
.item_subcategory ul li a{
height: 55px!important;
padding: 16px!important;
}
.ec-itemNav {
margin-bottom: 15px!important;
}
}
#campaign {
background-color: red;
}
#campaign a {
border: 3px double #fff;
margin: 2px!important;
padding: 8px!important;
color: white!important;
}
}
</style>
{% 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-categoryNaviRole">
<div class="ec-itemNav">
<ul class="ec-itemNav__nav">
<li>
<a href="{{ url('product_list') }}">全商品</a>
</li>
{% if campaign_valid %}
<li class="item_subcategory" id="campaign">
<a href="{{ url('product_list') }}?category_id={{ sale_category_id }}">セール</a>
</li>
{% endif %}
{% for Category in Categories %}
{% if Category.id not in [10,19,sale_category_id] %}
<li class="item_subcategory">
{{ tree(Category) }}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
</div>