app/template/default/Block/search_product.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. {% form_theme form 'Form/form_div_layout.twig' %}
  9. <div class="h_search">
  10.     <form method="get" class="searchform" action="{{ path('product_list') }}">
  11.         <div class="ec-headerSearch__category hidden">
  12.             <div class="ec-select ec-select_search">
  13.                 {{ form_widget(form.category_id, {'id': null, 'attr': {'class': 'category_id'}}) }}
  14.             </div>
  15.         </div>
  16.         <div class="ec-headerSearch__keyword hidden">
  17.             <div class="ec-input">
  18.                 {{ form_widget(form.name, {'id': null, 'attr': {'class': 'search-name', 'placeholder' : 'キーワードを入力' }} ) }}
  19.                 <button class="ec-headerSearch__keywordBtn" type="submit">
  20.                     <div class="ec-icon">
  21.                         <img src="{{ asset('assets/icon/search-dark.svg') }}" alt="">
  22.                     </div>
  23.                 </button>
  24.             </div>
  25.         </div>
  26.         <div class="tags hidden">{{ form_widget(form.tag) }}</div>
  27.         <div class="hidden">{{ form_widget(form.tag1) }}{{ form_widget(form.tag2) }}</div>
  28.         <div class="box ft_e">
  29.           <div class="list">
  30.             <dl>
  31.               <dt data-label="Category" data-labelsp="カテゴリーからさがす">Category</dt>
  32.               <dd class="category root"><ul></ul></dd>
  33.               <dd class="child1"></dd>
  34.               <dd class="child2"></dd>
  35.             </dl>
  36.             <dl>
  37.               <dt data-label="Color" data-labelsp="色からさがす">Color</dt>
  38.               <dd class="color"><ul></ul></dd>
  39.             </dl>
  40.             <dl>
  41.               <dt data-label="Material" data-labelsp="素材からさがす">Material</dt>
  42.               <dd class="material"><ul></ul></dd>
  43.             </dl>
  44.             {{ form_widget(form.word, {'id': null, 'attr': {'placeholder' : 'Keyword' }} ) }}
  45.             <input type="submit" value="検索する" disabled />
  46.           </div>
  47.           <div class="tag"></div>
  48.         </div>
  49.     </form>
  50. {% set Categories = repository('Eccube\\Entity\\Category').getList() %}
  51. {% macro tree(Category) %}
  52.     {% from _self import tree %}
  53.     <a href="{{ url('product_list') }}?category_id={{ Category.id }}">
  54.         {{ Category.name }}
  55.     </a>
  56.     {% if Category.children|length > 0 %}
  57.         <ul>
  58.             {% for ChildCategory in Category.children %}
  59.                 <li>
  60.                     {{ tree(ChildCategory) }}
  61.                 </li>
  62.             {% endfor %}
  63.         </ul>
  64.     {% endif %}
  65. {% endmacro %}
  66. {# @see https://github.com/bolt/bolt/pull/2388 #}
  67. {% from _self import tree %}
  68.     <ul class="cats hidden">
  69.         {% for Category in Categories %}
  70.             <li>
  71.                 {{ tree(Category) }}
  72.             </li>
  73.         {% endfor %}
  74.     </ul>
  75. </div>