app/template/default/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. {% set ng_id =  cat_id_ng_id %}
  9. {# {% set ng_id =  15 %} #}
  10. {% extends 'default_frame.twig' %}
  11. {% set body_class = 'product_page' %}
  12. {% block stylesheet %}
  13.     <link rel="stylesheet" href="{{ asset('assets/css/additional/page/product/list.css') }}{{ cache }}">
  14.     
  15. {% endblock %}
  16. {% block javascript %}
  17.     {{ include_dispatch('Product/js/list_script.twig') }}
  18.     
  19. {% endblock %}
  20. {% block main %}
  21.         <div class="ec-productRole">
  22.         </div>
  23.     {% if search_form.category_id.vars.errors|length > 0 %}
  24.         <div class="ec-searchnavRole">
  25.             <p class="errormsg text-danger">{{ 'ご指定のカテゴリは存在しません'|trans }}</p>
  26.         </div>
  27.     {% else %}
  28.         <div class="ec-searchnavRole">
  29.             <form name="form1" id="form1" method="get" action="?">
  30.                 {% for item in search_form %}
  31.                     <input type="hidden" id="{{ item.vars.id }}"
  32.                            name="{{ item.vars.full_name }}"
  33.                            {% if item.vars.value is not empty %}value="{{ item.vars.value }}" {% endif %}/>
  34.                 {% endfor %}
  35.             </form>
  36.             <div class="ec-searchnavRole__infos">
  37.                 <div class="ec-searchnavRole__counter">
  38.                     {% if pagination.totalItemCount > 0 %}
  39.                         {{ '<span class="ec-font-bold"></span>'|trans({ '%count%': pagination.totalItemCount })|raw }}
  40.                         {# {{ '<span class="ec-font-bold">%count%件</span><span>の商品が見つかりました</span>'|trans({ '%count%': pagination.totalItemCount })|raw }} #}
  41.                     {% else %}
  42.                         <span>{{ 'お探しの商品は見つかりませんでした'|trans }}</span>
  43.                     {% endif %}
  44.                 </div>
  45.                 {% if pagination.totalItemCount > 0 %}
  46.                     <div class="ec-searchnavRole__actions">
  47.                         <div class="ec-select">
  48.                             {{ form_widget(disp_number_form, {'id': '', 'attr': {'class': 'disp-number'}}) }}
  49.                             {{ form_widget(order_by_form, {'id': '', 'attr': {'class': 'order-by'}}) }}
  50.                         </div>
  51.                     </div>
  52.                 {% endif %}
  53.             </div>
  54. {#          //カテゴリ―
  55.    <div class="ec-searchnavRole__topicpath">
  56.                 <ol class="ec-topicpath">
  57.                     <li class="ec-topicpath__item"><a href="{{ url('product_list') }}">{{ '全て'|trans }}</a>
  58.                     </li>
  59.                     {% if Category is not null %}
  60.                         {% for Path in Category.path %}
  61.                             <li class="ec-topicpath__divider">|</li>
  62.                             <li class="ec-topicpath__item{% if loop.last %}--active{% endif %}"><a
  63.                                         href="{{ url('product_list') }}?category_id={{ Path.id }}">{{ Path.name }}</a>
  64.                             </li>
  65.                         {% endfor %}
  66.                     {% endif %}
  67.                     {% if search_form.vars.value and search_form.vars.value.name %}
  68.                         <li class="ec-topicpath__divider">|</li>
  69.                         <li class="ec-topicpath__item">{{ '「%name%」の検索結果'|trans({ '%name%': search_form.vars.value.name }) }}</li>
  70.                     {% endif %}
  71.                 </ol>
  72.             </div> #}
  73. {#          //検索用
  74.    <div class="ec-searchnavRole__infos">
  75.                 <div class="ec-searchnavRole__counter">
  76.                     {% if pagination.totalItemCount > 0 %}
  77.                         {{ '<span class="ec-font-bold">%count%件</span><span>の商品が見つかりました</span>'|trans({ '%count%': pagination.totalItemCount })|raw }}
  78.                     {% else %}
  79.                         <span>{{ 'お探しの商品は見つかりませんでした'|trans }}</span>
  80.                     {% endif %}
  81.                 </div>
  82.                 {% if pagination.totalItemCount > 0 %}
  83.                     <div class="ec-searchnavRole__actions">
  84.                         <div class="ec-select">
  85.                             {{ form_widget(disp_number_form, {'id': '', 'attr': {'class': 'disp-number'}}) }}
  86.                             {{ form_widget(order_by_form, {'id': '', 'attr': {'class': 'order-by'}}) }}
  87.                         </div>
  88.                     </div>
  89.                 {% endif %}
  90.             </div> #}
  91.         </div>
  92.         {% if pagination.totalItemCount > 0 %}
  93.             <div class="ec-shelfRole">
  94.                 <ul class="ec-shelfGrid">
  95.                     {% for Product in pagination %}
  96.                         
  97.                         {% set ng_check = false %}
  98.                           {% for ProductCategory in Product.ProductCategories %}
  99.                             {% if ProductCategory.Category.id is same as (ng_id) %}
  100.                              {% set ng_check = true %}
  101.                             {% endif %}
  102.                             {% endfor %}
  103.                             {# {% if ng_check is same as (false) %} #}
  104. {# {% if ng_check is same as (false) or (ng_check is same as (true) and app.request.query.get('page') == 'test') %} #}
  105.  {% if ng_check is same as (false) or (ng_check is same as (true) and app.request.query.get('page') is same as('test')) %}
  106.                         <li class="ec-shelfGrid__item">
  107.                             <a href="{{ url('product_detail', {'id': Product.id}) }}">
  108.                                 <p class="ec-shelfGrid__item-image">
  109.     {% set change_image_size = change_image_size( asset(Product.main_list_image|no_image_product, 'save_image'),600,600 ) %} 
  110.         {# サムネ画像のサイズ変更 #}
  111.                                     
  112.                                     <img src="{{  change_image_size }}">
  113.                                 </p>
  114.                                 <p>{{ Product.name }}</p>
  115.                                 {% if Product.description_list %}
  116.                                     <p>{{ Product.description_list|raw|nl2br }}</p>
  117.                                 {% endif %}
  118.                                 <p class="price02-default">
  119.                                     {% if Product.hasProductClass %}
  120.                                         {% if Product.getPrice02Min == Product.getPrice02Max %}
  121.                                             ¥{{ Product.getPrice02IncTaxMin|number_format }}
  122.                                         {% else %}
  123.                                             ¥{{ Product.getPrice02IncTaxMin|number_format }}~
  124.                                              {# {{ Product.getPrice02IncTaxMax|price }} #}
  125.                                         {% endif %}
  126.                                     {% else %}
  127.                                         ¥{{ Product.getPrice02IncTaxMin|number_format }}
  128.                                     {% endif %}
  129.                                 </p>
  130.                             </a>
  131.                             {% if Product.stock_find %}
  132.                                 {% set form = forms[Product.id] %}
  133.                                 <form name="form{{ Product.id }}" id="productForm{{ Product.id }}" action="{{ url('product_add_cart', {id:Product.id}) }}" method="post">
  134.                                                     {# 追加オプションがあるかどうか #}
  135.                 {# {% if Product.ProductOptions.snapshot %} #}
  136.                     {# {{ include('Product/option.twig') }} #}
  137.                     {# {{ include('Product/option.twig', ignore_missing=true) }} #}
  138.                     {# {{ include('Product/option_description.twig',ignore_missing=true) }} #}
  139.                 {# {% endif %} #}
  140.                                     <div class="ec-productRole__actions">
  141.                                         {% if form.classcategory_id1 is defined %}
  142.                                             <div class="ec-select">
  143.                                                 {{ form_widget(form.classcategory_id1) }}
  144.                                                 {{ form_errors(form.classcategory_id1) }}
  145.                                             </div>
  146.                                             {% if form.classcategory_id2 is defined %}
  147.                                                 <div class="ec-select">
  148.                                                     {{ form_widget(form.classcategory_id2) }}
  149.                                                     {{ form_errors(form.classcategory_id2) }}
  150.                                                 </div>
  151.                                             {% endif %}
  152.                                         {% endif %}
  153.                                         <div class="ec-numberInput"><span>{{ '数量'|trans }}</span>
  154.                                             {{ form_widget(form.quantity, {'attr': {'class': 'quantity'}}) }}
  155.                                             {{ form_errors(form.quantity) }}
  156.                                         </div>
  157.                                     </div>
  158.                                     {{ form_rest(form) }}
  159.                                 </form>
  160.                                 <div class="ec-productRole__btn">
  161.                                     <button type="submit" class="ec-blockBtn--action add-cart" data-cartid="{{ Product.id }}" form="productForm{{ Product.id }}">
  162.                                         {{ 'カートに入れる'|trans }}
  163.                                     </button>
  164.                                 </div>
  165.                             {% else %}
  166.                                 <div class="ec-productRole__btn">
  167.                                     <button type="button" class="ec-blockBtn--action" disabled="disabled">
  168.                                         {{ 'ただいま品切れ中です。'|trans }}
  169.                                     </button>
  170.                                 </div>
  171.                             {% endif %}
  172.                         </li>
  173.                             {% endif %}
  174.                         
  175.                     {% endfor %}
  176.                 </ul>
  177.             </div>
  178.             <div class="ec-modal">
  179.                 <input type="checkbox" id="ec-modal-checkbox" class="checkbox">
  180.                 <div class="ec-modal-overlay">
  181.                     <label for="ec-modal-checkbox" class="ec-modal-overlay-close"></label>
  182.                     <div class="ec-modal-wrap">
  183.                         <label for="ec-modal-checkbox" class="ec-modal-close"><span class="ec-icon"><img src="{{ asset('assets/icon/cross-dark.svg') }}" alt=""/></span></label>
  184.                         <div id="ec-modal-header" class="text-center">{{ 'カートに追加しました。'|trans }}</div>
  185.                         <div class="ec-modal-box">
  186.                             <div class="ec-role">
  187.                                 <label for="ec-modal-checkbox" class="ec-inlineBtn--cancel">{{ 'お買い物を続ける'|trans }}</label>
  188.                                 <a href="{{ url('cart') }}" class="ec-inlineBtn--action">{{ 'カートへ進む'|trans }}</a>
  189.                             </div>
  190.                         </div>
  191.                     </div>
  192.                 </div>
  193.             </div>
  194.             <div class="ec-pagerRole">
  195.                 {% include "pager.twig" with {'pages': pagination.paginationData} %}
  196.             </div>
  197.         {% endif %}
  198.     {% endif %}
  199. {% endblock %}