app/template/default/Block/category_nav_sp.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
  9. {% macro tree(Category) %}
  10.     {% from _self import tree %}
  11.     {% if checkCategoryIsFirstShipment(Category.id) %}
  12.     {% else %}
  13.         <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  14.             {{ Category.name }}
  15.         </a>
  16.         {% if Category.children|length > 0 %}
  17.             <ul>
  18.                 {% for ChildCategory in Category.children %}
  19.                     <li>
  20.                         {{ tree(ChildCategory) }}
  21.                     </li>
  22.                 {% endfor %}
  23.             </ul>
  24.         {% endif %}
  25.     {% endif %}
  26. {% endmacro %}
  27. {# @see https://github.com/bolt/bolt/pull/2388 #}
  28. {% from _self import tree %}
  29. <div class="ec-headerCategoryArea">
  30.     <div class="ec-headerCategoryArea__heading">
  31.         <p>{{ 'カテゴリ一覧'|trans }}</p>
  32.     </div>
  33.     <div class="ec-itemNav">
  34.         <ul class="ec-itemNav__nav">
  35.             {% for Category in Categories %}
  36.                 <li>
  37.                     {{ tree(Category) }}
  38.                 </li>
  39.             {% endfor %}
  40.         </ul>
  41.     </div>
  42. </div>