app/template/default/Product/list.twig line 1

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% set body_class = 'preload' %}
  3. {% block stylesheet %}
  4.     <link rel="stylesheet" href="{{ asset('assets/css/product-list.css', 'user_data') }}">
  5. {% endblock %}
  6. {% block javascript %}
  7.     <script>
  8.         eccube.productsClassCategories = {
  9.             {% for Product in pagination %}
  10.             "{{ Product.id|escape('js') }}": {{ class_categories_as_json(Product)|raw }}{% if loop.last == false %}, {% endif %}
  11.             {% endfor %}
  12.         };
  13.         $(function() {
  14.             // 表示件数を変更
  15.             $('.disp-number').change(function() {
  16.                 var dispNumber = $(this).val();
  17.                 $('#disp_number').val(dispNumber);
  18.                 $('#pageno').val(1);
  19.                 $("#form1").submit();
  20.             });
  21.             // 並び順を変更
  22.             $('.order-by').change(function() {
  23.                 var orderBy = $(this).val();
  24.                 $('#orderby').val(orderBy);
  25.                 $('#pageno').val(1);
  26.                 $("#form1").submit();
  27.             });
  28.         });
  29.     </script>
  30. {% endblock %}
  31. {% block main %}
  32.     <div class="common-bg">
  33.         {{ include('Block/pankuzu.twig') }}
  34.         <div class="content__wrapper">
  35.             <section class="product-list">
  36.                 <div class="h__ttl">{{ 'Item list'|trans }}</div>
  37.                 <h1 class="h__ttl02">{{ '商品一覧'|trans }}</h1>
  38.                 {% if search_form.category_id.vars.errors|length > 0 %}
  39.                     <div style="margin: 2rem; text-align: center;">
  40.                         <p class="errormsg text-danger">{{ 'ご指定のカテゴリは存在しません'|trans }}</p>
  41.                     </div>
  42.                 {% else %}
  43.                     <form name="form1" id="form1" method="get" action="?">
  44.                         {% for item in search_form %}
  45.                             <input type="hidden" id="{{ item.vars.id }}"
  46.                                 name="{{ item.vars.full_name }}"
  47.                                 {% if item.vars.value is not empty %}value="{{ item.vars.value }}" {% endif %}/>
  48.                         {% endfor %}
  49.                     </form>
  50.                     <div class="product-list__top">
  51.                         {% if pagination.totalItemCount > 0 %}
  52.                             {{ '<div class="product-list__top__txt">%count%件の商品が見つかりました</div>'|trans({ '%count%': pagination.totalItemCount })|raw }}
  53.                         {% else %}
  54.                             <div class="product-list__top__txt" style="margin: 2rem;">{{ 'お探しの商品は見つかりませんでした'|trans }}</div>
  55.                         {% endif %}
  56.                         {% if pagination.totalItemCount > 0 %}
  57.                             <div class="product-list__select__wrap">
  58.                                 <div class="product-list__top__select">
  59.                                     <div class="form__input quantity quantity01">
  60.                                         {{ form_widget(search_form.disp_number, {'id': '', 'attr': {'class': 'disp-number'}}) }}
  61.                                     </div>
  62.                                 </div>
  63.                                 <div class="product-list__top__select">
  64.                                     <div class="form__input quantity quantity02">
  65.                                         {{ form_widget(search_form.orderby, {'id': '', 'attr': {'class': 'order-by'}}) }}
  66.                                     </div>
  67.                                 </div>
  68.                             </div>
  69.                         {% endif %}
  70.                     </div>
  71.                     {% if pagination.totalItemCount > 0 %}
  72.                     <ul class="product-list__info">
  73.                         {% for Product in pagination %}
  74.                             <li>
  75.                                 <a href="{{ url('product_detail', {'id': Product.id}) }}">
  76.                                     <div class="product-list__info__img"><img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="{{ Product.name }}" {% if loop.index > 5 %} loading="lazy"{% endif %}></div>
  77.                                     <div class="product-list__info__name">{{ Product.name }}</div>
  78.                                     <div class="product-list__info__plice">
  79.                                     {% if Product.hasProductClass %}
  80.                                         {% if Product.getPrice02Min == Product.getPrice02Max %}
  81.                                             {{ Product.getPrice02IncTaxMin|price }}
  82.                                         {% else %}
  83.                                             {{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
  84.                                         {% endif %}
  85.                                     {% else %}
  86.                                         {{ Product.getPrice02IncTaxMin|price }}
  87.                                     {% endif %}
  88.                                     (税込)
  89.                                     </div>
  90.                                 </a>
  91.                             </li>
  92.                         {% endfor %}
  93.                     </ul>
  94.                     {% endif %}
  95.                 {% endif %}
  96.             </section>
  97.         </div>
  98.     </div>
  99. {% endblock %}