app/template/anivbtob/Product/list.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. {% extends 'default_frame.twig' %}
  9. {% set body_class = 'product_page' %}
  10. {% block stylesheet %}
  11. <style>
  12. {# .ec-headerSearch .ec-headerSearch__category .ec-select.ec-select_search{
  13. position: relative;
  14. border-top: 1px solid #ccc;
  15. border-left: 1px solid #ccc;
  16. border-bottom: 1px solid #ccc;
  17. background-color: #fff;
  18. color: #525263;
  19. /* border-top-right-radius: 10px; */
  20. /* border-top-left-radius: 10px; */
  21. border-top-left-radius:0;
  22. border-bottom-left-radius:0;
  23. }
  24. @media only screen and (min-width: 768px){
  25. .ec-headerSearch .ec-headerSearch__category .ec-select.ec-select_search {
  26. position: relative;
  27. border-top: 1px solid #ccc;
  28. border-left: 1px solid #ccc;
  29. border-bottom: 1px solid #ccc;
  30. background-color: #fff;
  31. color: #525263;
  32. border-top-left-radius:0;
  33. border-bottom-left-radius:0;
  34. }
  35. } #}
  36. </style>
  37. {% endblock %}
  38. {% block javascript %}
  39.     <script>
  40.         eccube.productsClassCategories = {
  41.             {% for Product in pagination %}
  42.             "{{ Product.id|escape('js') }}": {{ class_categories_as_json(Product)|raw }}{% if loop.last == false %}, {% endif %}
  43.             {% endfor %}
  44.         };
  45.         $(function() {
  46.             // 表示件数を変更
  47.             $('.disp-number').change(function() {
  48.                 var dispNumber = $(this).val();
  49.                 $('#disp_number').val(dispNumber);
  50.                 $('#pageno').val(1);
  51.                 $("#form1").submit();
  52.             });
  53.             // 並び順を変更
  54.             $('.order-by').change(function() {
  55.                 var orderBy = $(this).val();
  56.                 $('#orderby').val(orderBy);
  57.                 $('#pageno').val(1);
  58.                 $("#form1").submit();
  59.             });
  60.         });
  61.         $('.ec-modal-wrap').on('click', function(e) {
  62.             // モーダル内の処理は外側にバブリングさせない
  63.             e.stopPropagation();
  64.         });
  65.         $('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
  66.             $('.ec-modal').hide()
  67.         });
  68.     </script>
  69. {% endblock %}
  70. {% block main %}
  71.     {% if search_form.category_id.vars.errors|length > 0 %}
  72.         <div class="ec-searchnavRole">
  73.             <p class="errormsg text-danger">{{ 'ご指定のカテゴリは存在しません'|trans }}</p>
  74.         </div>
  75.     {% else %}
  76.         <div class="ec-searchnavRole">
  77.             <form name="form1" id="form1" method="get" action="?">
  78.                 {% for item in search_form %}
  79.                     <input type="hidden" id="{{ item.vars.id }}"
  80.                            name="{{ item.vars.full_name }}"
  81.                            {% if item.vars.value is not empty %}value="{{ item.vars.value }}" {% endif %}/>
  82.                 {% endfor %}
  83.             </form>
  84.             <div class="ec-searchnavRole__topicpath">
  85.                 <ol class="ec-topicpath">
  86.                     <li class="ec-topicpath__item">
  87.                     <a href="{{ url('product_list') }}">{{ '全て'|trans }}</a>
  88.                     </li>
  89.                     {% if Category is not null %}
  90.                         {% for Path in Category.path %}
  91.                             <li class="ec-topicpath__divider">|</li>
  92.                             <li class="ec-topicpath__item{% if loop.last %}--active{% endif %}"><a
  93.                                         href="{{ url('product_list') }}?category_id={{ Path.id }}">{{ Path.name }}</a>
  94.                             </li>
  95.                         {% endfor %}
  96.                     {% endif %}
  97.                     {% if search_form.vars.value and search_form.vars.value.name %}
  98.                         <li class="ec-topicpath__divider">|</li>
  99.                         <li class="ec-topicpath__item">{{ '「%name%」の検索結果'|trans({ '%name%': search_form.vars.value.name }) }}</li>
  100.                     {% endif %}
  101.                 </ol>
  102.             </div>
  103.             <div class="ec-searchnavRole__infos">
  104.                 <div class="ec-searchnavRole__counter">
  105.                     {% if pagination.totalItemCount > 0 %}
  106.                         {{ '<span class="ec-font-bold">%count%件</span><span>の商品が見つかりました</span>'|trans({ '%count%': pagination.totalItemCount })|raw }}
  107.                     {% else %}
  108.                         <span>{{ 'お探しの商品は見つかりませんでした'|trans }}</span>
  109.                     {% endif %}
  110.                 </div>
  111.                 {% if pagination.totalItemCount > 0 %}
  112.                     <div class="ec-searchnavRole__actions">
  113.                         <div class="ec-select">
  114.                             {{ form_widget(search_form.disp_number, {'id': '', 'attr': {'class': 'disp-number'}}) }}
  115.                             {{ form_widget(search_form.orderby, {'id': '', 'attr': {'class': 'order-by'}}) }}
  116.                         </div>
  117.                     </div>
  118.                 {% endif %}
  119.             </div>
  120.         </div>
  121.         {% if pagination.totalItemCount > 0 %}
  122.             <div class="ec-shelfRole">
  123.                 <ul class="ec-shelfGrid">
  124.                     {% for Product in pagination %}
  125.                         <li class="ec-shelfGrid__item" >
  126.                             <a href="{{ url('product_detail', {'id': Product.id}) }}">
  127.                                 <p class="ec-shelfGrid__item-image">
  128.                                     <img src="{{ asset(Product.main_list_image|no_image_product, 'save_image') }}" alt="{{ Product.name }}" {% if loop.index > 5 %} loading="lazy"{% endif %}>
  129.                                 </p>
  130.                                 <p style = "text-align:center;">{{ Product.name }}</p>
  131.                                 {% if Product.description_list %}
  132.                                     <p>{{ Product.description_list|raw|nl2br }}</p>
  133.                                 {% endif %}
  134.                                 <p class="price02-default" style = "text-align:center;">リース料金|お問い合わせ
  135.                                 {# ▼会員登録必須 #}
  136.                                 {% if is_granted('ROLE_USER') %}
  137.                                     {% if Product.hasProductClass %}
  138.                                         {% if Product.getPrice02Min == Product.getPrice02Max %}
  139.                                             {{ Product.getPrice02IncTaxMin|price }}
  140.                                         {% else %}
  141.                                             {{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
  142.                                         {% endif %}
  143.                                     {% else %}
  144.                                         {{ Product.getPrice02IncTaxMin|price }}
  145.                                     {% endif %}
  146.                                 {% endif %}  
  147.                                 {# ▲会員登録必須 #}
  148.                                 </p>
  149.                             </a>
  150.                             {% if Product.stock_find %}
  151.                                 {% set form = forms[Product.id] %}
  152.                                 {# <form name="form{{ Product.id }}" id="productForm{{ Product.id }}" action="{{ url('product_add_cart', {id:Product.id}) }}" method="post">
  153.                                     <div class="ec-productRole__actions">
  154.                                         {% if form.classcategory_id1 is defined %}
  155.                                             <div class="ec-select">
  156.                                                 {{ form_widget(form.classcategory_id1) }}
  157.                                                 {{ form_errors(form.classcategory_id1) }}
  158.                                             </div>
  159.                                             {% if form.classcategory_id2 is defined %}
  160.                                                 <div class="ec-select">
  161.                                                     {{ form_widget(form.classcategory_id2) }}
  162.                                                     {{ form_errors(form.classcategory_id2) }}
  163.                                                 </div>
  164.                                             {% endif %}
  165.                                         {% endif %}
  166.                                         <div class="ec-numberInput"><span>{{ '数量'|trans }}</span>
  167.                                             {{ form_widget(form.quantity, {'attr': {'class': 'quantity'}}) }}
  168.                                             {{ form_errors(form.quantity) }}
  169.                                         </div>
  170.                                     </div>
  171.                                     {{ form_rest(form) }}
  172.                                 </form> #}
  173.                                 {# <div class="ec-productRole__btn">
  174.                                     <button type="submit" class="ec-blockBtn--action add-cart" data-cartid="{{ Product.id }}" form="productForm{{ Product.id }}">
  175.                                         {{ 'カートに入れる'|trans }}
  176.                                     </button>
  177.                                 </div> #}
  178.                             {% else %}
  179.                                 <div class="ec-productRole__btn">
  180.                                     <button type="button" style = "color:#333;background:#fff;border:1px solid #ccc;" class="ec-blockBtn--action" disabled="disabled">
  181.                                         {{ '貸し出し中'|trans }}
  182.                                     </button>
  183.                                 </div>
  184.                             {% endif %}
  185.                         </li>
  186.                     {% endfor %}
  187.                 </ul>
  188.             </div>
  189.             <div class="ec-modal">
  190.                 <div class="ec-modal-overlay">
  191.                     <div class="ec-modal-wrap">
  192.                         <span class="ec-modal-close"><span class="ec-icon"><img src="{{ asset('assets/icon/cross-dark.svg') }}" alt=""/></span></span>
  193.                         <div id="ec-modal-header" class="text-center">{{ 'カートに追加しました。'|trans }}</div>
  194.                         <div class="ec-modal-box">
  195.                             <div class="ec-role">
  196.                                 <span class="ec-inlineBtn--cancel">{{ 'お買い物を続ける'|trans }}</span>
  197.                                 <a href="{{ url('cart') }}" class="ec-inlineBtn--action">{{ 'カートへ進む'|trans }}</a>
  198.                             </div>
  199.                         </div>
  200.                     </div>
  201.                 </div>
  202.             </div>
  203.             <div class="ec-pagerRole">
  204.                 {% include "pager.twig" with {'pages': pagination.paginationData} %}
  205.             </div>
  206.         {% endif %}
  207.     {% endif %}
  208. {% endblock %}