{% set hasCategory = false %}
{% set request_uri = app.request.server.get('REQUEST_URI') %}
{% if 'name=' in request_uri %}
{% set hasCategory = false %}
{% set RootCategory = "" %}
{% elseif 'name=' in request_uri and Category != "" %}
{% set hasCategory = true %}
{% set RootCategory = Category.RootCategory %}
{% elseif Category != "" %}
{% set hasCategory = true %}
{% set RootCategory = Category.RootCategory %}
{% else %}
{% set hasCategory = false %}
{% set RootCategory = "" %}
{% endif %}
{% if Category != "" %}
{% set RootCategory = Category.RootCategory %}
{% if RootCategory == '新入荷' or RootCategory == "おすすめ商品" %}
<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="buybtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=219">売る</a>
</div>
</div>
</div>
</div>
<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="salebtn">
<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')) }}
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#flow">
<div>
<p class="fs32 fwb">ご利用ガイド</p>
<p class="fs14">初めてご利用の方はこちらから</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}purchase">
<div>
<p class="fs32 fwb">高価買い取り</p>
<p class="fs14">オンラインフォームはこちらから</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#delivery">
<div>
<p class="fs32 fwb">配送料</p>
<p class="fs14">お会計5,000円以上で送料無料</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#payment">
<div>
<p class="fs32 fwb">お支払い方法</p>
<p class="fs14">カード・各種ペイ対応</p>
</div>
</a>
</div>
{% elseif RootCategory == '販売' %}
<!--現在のカテゴリID取得-->
{% set now_id = app.request.query.get('category_id') %}
<!--買い取り配下のカテゴリ取得-->
{% set cate_childs = RootCategory.getDescendants %}
<!--ルート表示-->
<!-- 現在カテゴリーから、親カテゴリに遡り「買い取り>ポケモンまで遡りたい」 -->
<!--現在カテゴリの上のカテゴリを取得 -->
{% set nowparent = Category.getParent() %}
{% set h = Category.hierarchy - 1 %}
<!--孫カテゴリ時に子カテゴリが表示された場合は親カテゴリへ -->
{% if nowparent == "シュヴァルツサイド" or nowparent == "ヴァイスサイド" %}
{% set nowparent = "ヴァイスシュヴァルツ" %}
{% endif %}
{% for cate in cate_childs %}
{% if h == cate.hierarchy %}
{# cate.name #}
{% endif %}
{% endfor %}
{% if nowparent == "ポケモン" or Category == "ポケモン" %}
<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} , {'sort_no' : 'DESC'}) #}
{% set Categories = repository('Eccube\\Entity\\Category').findByParentSorted(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=7">ポケモン</a>
<ul>
{% for Category in Categories %}
<li>{{ tree(Category) }}</li>
{% endfor %}
</ul>
</div>
</div>
{% 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 %}
{% elseif nowparent == "ヴァイスシュヴァルツ" or Category == "ヴァイスシュヴァルツ" %}
<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},{'sort_no' : 'DESC'}) #}
{% set Categories = repository('Eccube\\Entity\\Category').findByParentSorted(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=9">シュヴァルツサイド</a>
<ul>
{% for Category in Categories %}
<li>{{ tree(Category) }}</li>
{% endfor %}
</ul>
</div>
</div>
{# set Categories = repository('Eccube\\Entity\\Category').findBy({'Parent' : 10},{'sort_no' : 'DESC'}) #}
{% set Categories = repository('Eccube\\Entity\\Category').findByParentSorted(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=10">ヴァイスサイド</a>
<ul>
{% for Category in Categories %}
<li>{{ tree(Category) }}</li>
{% endfor %}
</ul>
</div>
</div>
{% else %}
<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="buybtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=219">売る</a>
</div>
</div>
</div>
</div>
<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="salebtn">
<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')) }}
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#flow">
<div>
<p class="fs32 fwb">ご利用ガイド</p>
<p class="fs14">初めてご利用の方はこちらから</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}purchase">
<div>
<p class="fs32 fwb">高価買い取り</p>
<p class="fs14">オンラインフォームはこちらから</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#delivery">
<div>
<p class="fs32 fwb">配送料</p>
<p class="fs14">お会計5,000円以上で送料無料</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#payment">
<div>
<p class="fs32 fwb">お支払い方法</p>
<p class="fs14">カード・各種ペイ対応</p>
</div>
</a>
</div>
{% endif %}
{% elseif RootCategory == '買い取り' %}
<!--現在のカテゴリID取得-->
{% set now_id = app.request.query.get('category_id') %}
<!--買い取り配下のカテゴリ取得-->
{% set cate_childs = RootCategory.getDescendants %}
<!--ルート表示-->
<!-- 現在カテゴリーから、親カテゴリに遡り「買い取り>ポケモンまで遡りたい」 -->
<!--現在カテゴリの上のカテゴリを取得 -->
{% set nowparent = Category.getParent() %}
{% set h = Category.hierarchy - 1 %}
<!--孫カテゴリ時に子カテゴリが表示された場合は親カテゴリへ -->
{% if nowparent == "シュヴァルツサイド" or nowparent == "ヴァイスサイド" %}
{% set nowparent = "ヴァイスシュヴァルツ" %}
{% endif %}
{% for cate in cate_childs %}
{% if h == cate.hierarchy %}
{# cate.name #}
{% endif %}
{% endfor %}
{% if nowparent == "ポケモン" or Category == "ポケモン" %}
<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' : 219},{'sort_no' : 'DESC'}) #}
{% set Categories = repository('Eccube\\Entity\\Category').findByParentSorted(219) %}
{# @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 %}
{% if loop.index == 8 %}
<div class="catdn">
{% endif %}
<li>{{ tree(Category) }}</li>
{% if loop.last %}
</div>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{% elseif nowparent == "ヴァイスシュヴァルツ" or Category == "ヴァイスシュヴァルツ" %}
<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="salebtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=8">買う</a>
</div>
</div>
<div class="graybtn">
<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' : 221},{'sort_no' : 'DESC'}) #}
{% set Categories = repository('Eccube\\Entity\\Category').findByParentSorted(221) %}
{# @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 %}
{% if loop.index == 8 %}
<div class="catdn2">
{% endif %}
<li>{{ tree(Category) }}</li>
{% if loop.last %}
</div>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{# set Categories = repository('Eccube\\Entity\\Category').findBy({'Parent' : 220},{'sort_no' : 'DESC'}) #}
{% set Categories = repository('Eccube\\Entity\\Category').findByParentSorted(220) %}
{# @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 %}
{% if loop.index == 8 %}
<div class="catdn3">
{% endif %}
<li>{{ tree(Category) }}</li>
{% if loop.last %}
</div>
{% endif %}
{% endfor %}
</ul>
</div>
</div>
{% else %}
<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="buybtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=219">売る</a>
</div>
</div>
</div>
</div>
<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="salebtn">
<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')) }}
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#flow">
<div>
<p class="fs32 fwb">ご利用ガイド</p>
<p class="fs14">初めてご利用の方はこちらから</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}purchase">
<div>
<p class="fs32 fwb">高価買い取り</p>
<p class="fs14">オンラインフォームはこちらから</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#delivery">
<div>
<p class="fs32 fwb">配送料</p>
<p class="fs14">お会計5,000円以上で送料無料</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#payment">
<div>
<p class="fs32 fwb">お支払い方法</p>
<p class="fs14">カード・各種ペイ対応</p>
</div>
</a>
</div>
{% endif %}
{% else %}
<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="buybtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=219">売る</a>
</div>
</div>
</div>
</div>
<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="salebtn">
<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')) }}
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#flow">
<div>
<p class="fs32 fwb">ご利用ガイド</p>
<p class="fs14">初めてご利用の方はこちらから</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}purchase">
<div>
<p class="fs32 fwb">高価買い取り</p>
<p class="fs14">オンラインフォームはこちらから</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#delivery">
<div>
<p class="fs32 fwb">配送料</p>
<p class="fs14">お会計5,000円以上で送料無料</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#payment">
<div>
<p class="fs32 fwb">お支払い方法</p>
<p class="fs14">カード・各種ペイ対応</p>
</div>
</a>
</div>
{% endif %}
{% else %}
<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="buybtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=219">売る</a>
</div>
</div>
</div>
</div>
<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="salebtn">
<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')) }}
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#flow">
<div>
<p class="fs32 fwb">ご利用ガイド</p>
<p class="fs14">初めてご利用の方はこちらから</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}purchase">
<div>
<p class="fs32 fwb">高価買い取り</p>
<p class="fs14">オンラインフォームはこちらから</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#delivery">
<div>
<p class="fs32 fwb">配送料</p>
<p class="fs14">お会計5,000円以上で送料無料</p>
</div>
</a>
</div>
<div class="side-red-btn">
<a href="{{url('homepage')}}user_data/flow#payment">
<div>
<p class="fs32 fwb">お支払い方法</p>
<p class="fs14">カード・各種ペイ対応</p>
</div>
</a>
</div>
{% endif %}