app/template/default/Block/category.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 Products = CustomizeCatProduct() %}
  9. <section class="categories">
  10. <div class="wrap">
  11. <h2 class="subtitle"><strong class="fadein active"><i>C</i>ategories</strong>カテゴリー</h2>
  12. <div class="search">
  13. <form method="get" action="{{ path('product_list') }}">
  14. <input type="text" name="name" maxlength="50" placeholder="キーワードを入力"><button type="submit"><img src="{{ asset('assets/images/icon-glass.svg', 'user_data') }}" alt="検索"></button>
  15. </form>
  16. </div>
  17. <ul>
  18. {% if Products|length > 0 %}
  19.     {% for categorys in Products.category %}
  20.     
  21.     {%if categorys.ProductCategories|length != '0'%}
  22.     
  23.     {#% if categorys.Parent is same as(null)%#}
  24.     <li>
  25.     <a href="{{ url('product_list') }}?category_id={{categorys.id}}">
  26.     <div class="pic">
  27.     {% set num = categorys.id|sprintf_tow %}
  28.     {% set imgs = "assets/images/cat" ~ num ~ ".png" %}
  29.     
  30.     {%if categorys.category_image%}
  31.     <img src="{{ asset(categorys.category_image|no_image_product, 'save_image') }}" alt="{{ categorys.name }}" style="width:auto; height:100%;">
  32.     {%else%}
  33.     <img src="{{ asset(imgs, 'user_data') }}" alt="">
  34.     {%endif%}
  35.     </div>
  36.     <p>{{categorys.name|raw}}</p>
  37.     </a>
  38.     {#{dump(categorys)}#}
  39.     
  40.     </li>
  41.     {#% endif %#}
  42.     {% endif %}
  43.     
  44.     {% endfor %}
  45. {% endif %}
  46. </ul>
  47. <p class="txtC"><a href="{{ url('product_list') }}" class="btn">All goods</a></p>
  48. </div>
  49. </section>