{% 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 != "" %}
{% block javascript %}
<script>
$(function() {
{% if RootCategory == "買い取り" or 'id=217' in request_uri or 'id=218' in request_uri%}
$('.cat_mob_top-content-box').css('background-color','#22b573');
$('.mob_top-content-box').css('background-color','#22b573');
{% endif %}
});
</script>
{% endblock %}
{% set RootCategory = Category.RootCategory %}
{% if RootCategory == '新入荷' or RootCategory == "おすすめ商品" %}
<div class="mob-topnav">
<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>
</div>
<div class="mob-topnsearch">
{{ render(path('block_side_serch')) }}
</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 == "ポケモン" %}
{% set cnt = 7 %}
{{ render(path('block_side_serch')) }}
{# set Categories = repository('Eccube\\Entity\\Category').findBy({'Parent' : 7}) #}
{% 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>
{% elseif nowparent == "ヴァイスシュヴァルツ" or Category == "ヴァイスシュヴァルツ" %}
{% set cnt = 7 %}
{{ render(path('block_side_serch')) }}
{# set Categories = repository('Eccube\\Entity\\Category').findBy({'Parent' : 9}) #}
{% 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}) #}
{% 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="mob-topnav">
<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>
</div>
<div class="mob-topnsearch">
{{ render(path('block_side_serch')) }}
</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 == "ポケモン" %}
{% set cnt = 7 %}
{{ render(path('block_side_serch_buy')) }}
{# set Categories = repository('Eccube\\Entity\\Category').findBy({'Parent' : 219}) #}
{% 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=7">ポケモン</a>
<ul>
{% for Category in Categories %}
<li>{{ tree(Category) }}</li>
{% endfor %}
</ul>
</div>
</div>
{% elseif nowparent == "ヴァイスシュヴァルツ" or Category == "ヴァイスシュヴァルツ" %}
{% set cnt = 7 %}
{{ render(path('block_side_serch_buy')) }}
{# set Categories = repository('Eccube\\Entity\\Category').findBy({'Parent' : 221}) #}
{% 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=9">シュヴァルツサイド</a>
<ul>
{% for Category in Categories %}
<li>{{ tree(Category) }}</li>
{% endfor %}
</ul>
</div>
</div>
{# set Categories = repository('Eccube\\Entity\\Category').findBy({'Parent' : 220}) #}
{% 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=10">ヴァイスサイド</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 %}
{% else %}
<div class="mob-topnav">
<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>
</div>
<div class="mob-topnsearch">
{{ render(path('block_side_serch_buy')) }}
</div>
{% endif %}
{% else %}
<div class="mob-topnav">
<div class="title-box">
<a href="{{url('homepage')}}products/list?category_id=708" class="titlebtn"><img src="{{ asset('/html/user_data/assets/img/box.png') }}" alt="新品&中古box"></a>
<div class="sbbtn-box">
<div class="nbbtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=708">新品BOX</a>
</div>
</div>
<div class="ubbtn">
<div>
<a href="{{url('homepage')}}products/list?category_id=708">予約BOX</a>
</div>
</div>
</div>
</div>
<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>
<div class="mob-topnav mob-topnav_sec">
<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>
</div>
<div class="mob-topnsearch">
{{ render(path('block_side_serch_buy')) }}
</div>
{% endif %}
{% else %}
<div class="mob-topnav">
<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>
</div>
<div class="mob-topnsearch">
{{ render(path('block_side_serch')) }}
</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 %}