app/template/uarts/Block/category_nav_pc.twig line 1

Open in your IDE?
  1. {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
  2. <h3 class="border_ttl"><span>取り扱い商品</span></h3>
  3. <ul class="gnav_list">
  4.     {% for Category in Categories %}
  5.     <li class="mb40 spmb10">
  6.         <p class="accordion"><a href="{{ url('product_list') }}?category_id={{ Category.id }}">{{ Category.name }}<span>({{ Category.ProductCategories|length}})</span></a></p>
  7.         {% if Category.children|length > 0 %}
  8.         <ul>
  9.             {% for ChildCategory in Category.children %}
  10.             {% set CategoryOption = repository('Plugin\\CategoryOption\\Entity\\CategoryOption').getCategory(ChildCategory.id) %}
  11.             <li>
  12.                 <a href="{{ url('product_list') }}?category_id={{ ChildCategory.id }}">
  13.                     {% if CategoryOption and CategoryOption.img %}
  14.                     <img src="{{ asset(CategoryOption.img|no_image_product, 'save_image') }}" alt="{{ ChildCategory.name }}" width="60">
  15.                     {% else %}
  16.                     <img src="{{ asset(''|no_image_product, 'save_image') }}" alt="{{ ChildCategory.name }}" width="60">
  17.                     {% endif %}
  18.                    
  19.                     <p>{{ ChildCategory.name }}<span>({{ ChildCategory.ProductCategories|length}})</span></p>
  20.                 </a>
  21.             </li>
  22.             {% endfor %}
  23.         </ul>
  24.         {% endif %}
  25.     </li>
  26.     {% endfor %}
  27. </ul>