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

Open in your IDE?
  1. {% extends 'default_frame.twig' %}
  2. {% set body_class = 'product_page' %}
  3. {% block javascript %}
  4.     <script>
  5.         eccube.productsClassCategories = {
  6.             {% for Product in pagination %}
  7.             "{{ Product.id|escape('js') }}": {{ class_categories_as_json(Product)|raw }}{% if loop.last == false %}, {% endif %}
  8.             {% endfor %}
  9.         };
  10.         $(function() {
  11.             // 表示件数を変更
  12.             $('.disp-number').change(function() {
  13.                 var dispNumber = $(this).val();
  14.                 $('#disp_number').val(dispNumber);
  15.                 $('#pageno').val(1);
  16.                 $("#form1").submit();
  17.             });
  18.             // 並び順を変更
  19.             $('.order-by').change(function() {
  20.                 var orderBy = $(this).val();
  21.                 $('#orderby').val(orderBy);
  22.                 $('#pageno').val(1);
  23.                 $("#form1").submit();
  24.             });
  25.             $('.add-cart').on('click', function(e) {
  26.                 var $form = $(this).parents('li').find('form');
  27.                 // 個数フォームのチェック
  28.                 var $quantity = $form.parent().find('.quantity');
  29.                 if ($quantity.val() < 1) {
  30.                     $quantity[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
  31.                     setTimeout(function() {
  32.                         loadingOverlay('hide');
  33.                     }, 100);
  34.                     return true;
  35.                 } else {
  36.                     $quantity[0].setCustomValidity('');
  37.                 }
  38.                 e.preventDefault();
  39.                 $.ajax({
  40.                     url: $form.attr('action'),
  41.                     type: $form.attr('method'),
  42.                     data: $form.serialize(),
  43.                     dataType: 'json',
  44.                     beforeSend: function(xhr, settings) {
  45.                         // Buttonを無効にする
  46.                         $('.add-cart').prop('disabled', true);
  47.                     }
  48.                 }).done(function(data) {
  49.                     // レスポンス内のメッセージをalertで表示
  50.                     $.each(data.messages, function() {
  51.                         $('#ec-modal-header').text(this);
  52.                     });
  53.                     $('.ec-modal').show()
  54.                     // カートブロックを更新する
  55.                     $.ajax({
  56.                         url: '{{ url('block_cart') }}',
  57.                         type: 'GET',
  58.                         dataType: 'html'
  59.                     }).done(function(html) {
  60.                         $('.ec-headerRole__cart').html(html);
  61.                     });
  62.                 }).fail(function(data) {
  63.                     alert('{{ 'カートへの追加に失敗しました。'|trans }}');
  64.                 }).always(function(data) {
  65.                     // Buttonを有効にする
  66.                     $('.add-cart').prop('disabled', false);
  67.                 });
  68.             });
  69.         });
  70.         $('.ec-modal-wrap').on('click', function(e) {
  71.             // モーダル内の処理は外側にバブリングさせない
  72.             e.stopPropagation();
  73.         });
  74.         $('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
  75.             $('.ec-modal').hide()
  76.         });
  77.     </script>
  78. {% endblock %}
  79. {% block main %}
  80.     {# SP 検索項目表示エリア #}
  81.     <div class="seach_resutl seach_resutl__sp">
  82.         <ul class="seach_resutl__list">
  83.             {# 検索ワード #}
  84.             {% if search_form.vars.value and search_form.vars.value.name %}
  85.                 <li class="ec-topicpath__item">{{ '「%name%」の検索結果'|trans({ '%name%': search_form.vars.value.name }) }}</li>
  86.             {% endif %}
  87.             {# カテゴリ名 #}
  88.             {% if Category is not null %}
  89.                 {% for Path in Category.path %}
  90.                     {# 親カテゴリは非表示 #}
  91.                     {% if Path.id != 34 and Path.id != 7 %}
  92.                         {% set current_id = Path.id %}
  93.                         {% set current_name = Path.name %}
  94.                         <li>{{ current_name }}</li>
  95.                     {% endif %}
  96.                 {% endfor %}
  97.             {% endif %}
  98.             {# 検索項目 #}
  99.             {% if ProductItems is defined %}
  100.                 {% for ProductItem in ProductItems %}
  101.                     {% set name = 'productplus_' ~ ProductItem.id %}
  102.                     {% if  ProductItem.input_type >= constant('Plugin\\ProductPlus42\\Entity\\ProductItem::SELECT_TYPE') %}
  103.                         {% for choice in form[name].vars.choices %}
  104.                             {% if choice.value in form[name].vars.data %}
  105.                                 <li>{{ choice.label }}</li>
  106.                             {% endif %}
  107.                         {% endfor %}
  108.                     {% else %}
  109.                     {% endif %}
  110.                 {% endfor %}
  111.             {% endif %}
  112.             {# 高さ #}
  113.             {% if searchData.hmin or searchData.hmax %}
  114.                 <li>
  115.                     高さ
  116.                     {% if searchData.hmin %}
  117.                         {{ searchData.hmin }}mm
  118.                     {% endif %}
  119.                     <span>~</span>
  120.                     {% if searchData.hmax %}
  121.                         {{ searchData.hmax }}mm
  122.                     {% endif %}
  123.                 </li>
  124.             {% endif %}
  125.             {# 幅 #}
  126.             {% if searchData.wmin or searchData.wmax %}
  127.                 <li>
  128.                     幅
  129.                     {% if searchData.wmin %}
  130.                         {{ searchData.wmin }}mm
  131.                     {% endif %}
  132.                     <span>~</span>
  133.                     {% if searchData.wmax %}
  134.                         {{ searchData.wmax }}mm
  135.                     {% endif %}
  136.                 </li>
  137.             {% endif %}
  138.             {# 価格帯 #}
  139.             {% if form.pmin.vars.value != '' or form.pmax.vars.value != '' %}
  140.                 <li>
  141.                     {% if form.pmin.vars.value != '' %}
  142.                         {{ form.pmin.vars.value|number_format }}円
  143.                     {% endif %}
  144.                     <span>~</span>
  145.                     {% if form.pmax.vars.value != '' %}
  146.                         {{ form.pmax.vars.value|number_format }}円
  147.                     {% endif %}
  148.                 </li>
  149.             {% endif %}
  150.         </ul>
  151.         {# リセットボタン #}
  152.         <a class="searchResetLink">検索クリア</a>
  153.     </div><!--/.seach_resutl-->
  154.     {% if search_form.category_id.vars.errors|length > 0 %}
  155.         <div class="ec-searchnavRole">
  156.             <p class="errormsg text-danger">{{ 'ご指定のカテゴリは存在しません'|trans }}</p>
  157.         </div>
  158.     {% else %}
  159.         <div class="ec-searchnavRole">
  160.             <form name="form1" id="form1" method="get" action="?">
  161.                 {% for item in search_form %}
  162.                     <input type="hidden" id="{{ item.vars.id }}"
  163.                            name="{{ item.vars.full_name }}"
  164.                            {% if item.vars.value is not empty %}value="{{ item.vars.value }}" {% endif %}/>
  165.                 {% endfor %}
  166.             </form>
  167.             <div class="ec-searchnavRole__infos">
  168.                 <div class="ec-searchnavRole__counter">
  169.                     {% if pagination.totalItemCount > 0 %}
  170.                         {{ '<span class="ec-font-bold">対象商品 <span>%count%</span> 件</span>'|trans({ '%count%': pagination.totalItemCount })|raw }}
  171.                     {% else %}
  172.                         <span>{{ 'お探しの商品は見つかりませんでした'|trans }}</span>
  173.                     {% endif %}
  174.                 </div>
  175.                 {% if pagination.totalItemCount > 0 %}
  176.                     <div class="ec-searchnavRole__actions">
  177.                         <div class="ec-select">
  178.                             {{ form_widget(search_form.disp_number, {'id': '', 'attr': {'class': 'disp-number'}}) }}
  179.                             {{ form_widget(search_form.orderby, {'id': '', 'attr': {'class': 'order-by'}}) }}
  180.                         </div>
  181.                     </div>
  182.                 {% endif %}
  183.             </div>
  184.         </div>
  185.         {% if pagination.totalItemCount > 0 %}
  186.             <div class="ec-shelfRole">
  187.                 <ul class="ec-shelfGrid">
  188.                     {% for Product in pagination %}
  189.                         <li class="ec-shelfGrid__item">
  190.                             <a href="{{ url('product_detail', {'id': Product.id}) }}">
  191.                                 <p class="ec-shelfGrid__item-image">
  192.                                     <img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="{{ Product.name }}" {% if loop.index > 5 %} loading="lazy"{% endif %}>
  193.                                 </p>
  194.                                 <p>{{ Product.name }}</p>
  195.                                 {% if Product.description_list %}
  196.                                     <p>{{ Product.description_list|raw|nl2br }}</p>
  197.                                 {% endif %}
  198.                                 <p class="price02-default">
  199.                                     {% if Product.hasProductClass %}
  200.                                         {% if Product.getPrice02Min == Product.getPrice02Max %}
  201.                                             {{ Product.getPrice02IncTaxMin|price }}
  202.                                         {% else %}
  203.                                             {{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
  204.                                         {% endif %}
  205.                                     {% else %}
  206.                                         {{ Product.getPrice02IncTaxMin|price }}
  207.                                     {% endif %}
  208.                                 </p>
  209.                             </a>
  210.                         </li>
  211.                     {% endfor %}
  212.                 </ul>
  213.             </div>
  214.             <div class="ec-modal">
  215.                 <div class="ec-modal-overlay">
  216.                     <div class="ec-modal-wrap">
  217.                         <span class="ec-modal-close"><span class="ec-icon"><img src="{{ asset('assets/icon/cross-dark.svg') }}" alt=""/></span></span>
  218.                         <div id="ec-modal-header" class="text-center">{{ 'カートに追加しました。'|trans }}</div>
  219.                         <div class="ec-modal-box">
  220.                             <div class="ec-role">
  221.                                 <span class="ec-inlineBtn--cancel">{{ 'お買い物を続ける'|trans }}</span>
  222.                                 <a href="{{ url('cart') }}" class="ec-inlineBtn--action">{{ 'カートへ進む'|trans }}</a>
  223.                             </div>
  224.                         </div>
  225.                     </div>
  226.                 </div>
  227.             </div>
  228.             <div class="ec-pagerRole">
  229.                 {% include "pager.twig" with {'pages': pagination.paginationData} %}
  230.             </div>
  231.         {% endif %}
  232.     {% endif %}
  233.     <a class="sp_filtter_btn">
  234.         <img src="{{ asset('assets/img/common/plus_icon.png') }}">
  235.         <span class="txt">絞り込み</span>
  236.     </a>
  237. {% endblock %}