{% set parentCategory = repository('Eccube\\Entity\\Category').findOneBy({'name': 'カテゴリー'}) %}
{% if parentCategory %}
{% set subCategories = parentCategory.Children %}
{% else %}
{% set subCategories = [] %}
{% endif %}
<div class="drawer drawer_right"><a class="drawer_right_close spm" href="#"> </a>
<div class="drawer_group drawer_right_group">
<div class="drawer_right_top"><a class="drawer_right_close desktop" href="#"> </a>
<div class="drawer_right_fake"></div>
</div>
<h2 class="drawer_right_title">すべての商品を見る</h2>
<div class="drawer_right_list">
{% for category in subCategories %}
<div class="drawer_right_item">
<a class="hover_opacity" href="{{ url('product_list', {'category_id': category.id}) }}">
<img class="drawer_right_item_img" src="{{ asset('assets/img/categories/', 'user_data') }}category-{{ category.id }}.png" alt="{{ category.name }}" />
<span>{{ category.name }}</span>
</a>
</div>
{% else %}
<p>カテゴリが見つかりません。</p>
{% endfor %}
</div>
</div>
</div>