{% set break = false %}
{% set cat = "" %}
{% if Product is not null %}
{% if Product.ProductCategories is not empty %}
{% for ProductCategory in Product.ProductCategories if not break %}
{% if ProductCategory.Category.name == "ヴァイスシュヴァルツ" %}
{% set cat = ProductCategory.Category.name %}
{% set break = true %}
{% elseif ProductCategory.Category.name == "ポケモン" %}
{% set cat = ProductCategory.Category.name %}
{% set break = true %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% if cat == "ヴァイスシュヴァルツ" %}
<div class="title-box">
<a href="{{url('homepage')}}products/list?category_id=8" class="titlebtn"><img src="{{ asset('/html/user_data/assets/img/weis.png') }}" alt=""></a>
<div class="sbbtn-box">
<div class="graybtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=8">買う</a>
</div>
</div>
<div class="buybtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=218">売る</a>
</div>
</div>
</div>
</div>
{{ render(path('block_side_serch_buy')) }}
{% set Categories = repository('Eccube\\Entity\\Category').findBy({'Parent' : 9}) %}
{# @see https://github.com/bolt/bolt/pull/2388 #}
{% from _self import tree %}
<div class="side-cat1">
<div class="side-cat-smallbox">
<a href="{{url('homepage')}}products/list?category_id=221">シュヴァルツサイド</a>
<ul>
{% for Category in Categories %}
<li>{{ tree(Category) }}</li>
{% endfor %}
</ul>
</div>
</div>
{% set Categories = repository('Eccube\\Entity\\Category').findBy({'Parent' : 10}) %}
{# @see https://github.com/bolt/bolt/pull/2388 #}
{% from _self import tree %}
<div class="side-cat1">
<div class="side-cat-smallbox">
<a href="{{url('homepage')}}products/list?category_id=220">ヴァイスサイド</a>
<ul>
{% for Category in Categories %}
<li>{{ tree(Category) }}</li>
{% endfor %}
</ul>
</div>
</div>
{% elseif cat == "ポケモン" %}
<div class="title-box">
<a href="{{url('homepage')}}products/list?category_id=7" class="titlebtn"><img src="{{ asset('/html/user_data/assets/img/poke.png') }}" alt=""></a>
<div class="sbbtn-box">
<div class="salebtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=7">買う</a>
</div>
</div>
<div class="graybtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=219">売る</a>
</div>
</div>
</div>
</div>
{{ render(path('block_side_serch_buy')) }}
{% set Categories = repository('Eccube\\Entity\\Category').findBy({'Parent' : 7}) %}
{# @see https://github.com/bolt/bolt/pull/2388 #}
{% from _self import tree %}
<div class="side-cat1">
<div class="side-cat-smallbox">
<a href="{{url('homepage')}}products/list?category_id=219">ポケモン</a>
<ul>
{% for Category in Categories %}
<li>{{ tree(Category) }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}
{% 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 %}