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.     <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  12.         {{ Category.name }}
  13.     </a>
  14.     {% if Category.children|length > 0 %}
  15.         <ul>
  16.             {% for ChildCategory in Category.children %}
  17.                 <li>
  18.                     {{ tree(ChildCategory) }}
  19.                 </li>
  20.             {% endfor %}
  21.         </ul>
  22.     {% endif %}
  23. {% endmacro %}
  24. {# @see https://github.com/bolt/bolt/pull/2388 #}
  25. {% from _self import tree %}
  26. <div class="ec-headerLinkArea">
  27.     <div class="ec-headerLink__list">
  28.         <a class="ec-headerLink__item" href="{{ url(eccube_config.eccube_user_data_route, {'route': 'flow'}) }}">
  29.             <div class="ec-headerLink__icon">
  30.                 <i class="fas fa-book fa-fw"></i>
  31.             </div>
  32.             <span>{{ 'お取引ガイド'|trans }}</span>
  33.         </a>
  34.     </div>
  35.     <div class="ec-headerLink__list">
  36.         <a class="ec-headerLink__item" href="{{ url(eccube_config.eccube_user_data_route, {'route': 'introduction'}) }}">
  37.             <div class="ec-headerLink__icon">
  38.                 <i class="fas fa-lightbulb fa-fw"></i>
  39.             </div>
  40.             <span>{{ '会員登録のメリット'|trans }}</span>
  41.         </a>
  42.     </div>
  43. </div>
  44. <div class="ec-headerCategoryArea">
  45.     <div class="ec-headerCategoryArea__heading">
  46.         <p>{{ 'カテゴリ一覧'|trans }}</p>
  47.     </div>
  48.     <div class="ec-itemNav">
  49.         <ul class="ec-itemNav__nav">
  50.             {% for ProCategory in Categories %}
  51.                 {% if ProCategory.id == 1 %}
  52.                     <li>
  53.                         <a href="{{ url('product_list') }}">{{ '商品一覧'|trans }}</a>
  54.                     </li>
  55.                     {% for Category in ProCategory.children %}
  56.                         <li>
  57.                             {{ tree(Category) }}
  58.                         </li>
  59.                     {% endfor %}
  60.                 {% endif %}
  61.             {% endfor %}
  62.         </ul>
  63.     </div>
  64. </div>