app/template/default/Block/product_lists.twig line 11

Open in your IDE?
  1. text
  2. <div class="ec-role mt-1">
  3.     <div class="d-flex flex-column flex-md-row justify-content-between">
  4.         <h2 class="ec-secHeading mt-0">
  5.             <span class="ec-secHeading__en">PRODUCTS</span>
  6.             <span class="ec-secHeading__line"></span>
  7.             <span class="ec-secHeading__ja">製品一覧</span>
  8.         </h2>
  9.         <div class="d-none d-md-block ec-headerNaviRole__search">
  10.             {{ render(path('block_search_product')) }}
  11.         </div>
  12.     </div>
  13.     {# tag list #}
  14.     {% set tags = repository('Eccube\\Entity\\Tag').findAll() %}
  15.     {% if tags|length > 0 %}
  16.       <div class="tag-list mt-2">
  17.         <ul class="d-flex gap-1" style="padding-left:0">
  18.           {% for tag in tags %}
  19.             {% set isActive = app.request.get('tag_id') == tag.id %}
  20.             <li class="">
  21.               <a class="btn btn-sm btn-outline-secondary{% if isActive %} btn-primary{% endif %}" href="{{ url('product_list', {'tag_id': tag.id}) }}">{{ tag.name }}</a>
  22.             </li>
  23.           {% endfor %}
  24.         </ul>
  25.       </div>
  26.     {% endif %}
  27.     {#{% set products = repository("Eccube\\Entity\\Product")#}
  28.     {#    .createQueryBuilder('product')#}
  29.     {#    .setMaxResults(12)#}
  30.     {#    .getQuery()#}
  31.     {#    .getResult()#}
  32.     {#%}#}
  33.     {% if products is not null %}
  34.     <div class="ec-newItemRole pt-2">
  35.             <div class="ec-shelfGrid">
  36.                 {% for product in products %}
  37.                     <div class="ec-shelfGrid__item">
  38.                         <a href="{{ url('product_detail', {'id': product.id}) }}">
  39.                             <img src="{{ asset(product.main_list_image|no_image_product, 'save_image') }}">
  40.                             <p class="ec-newItemRole__listItemTitle">{{ product.name }}</p>
  41.                             <p class="ec-newItemRole__listItemPrice">
  42.                                 {% if is_granted("ROLE_USER") %}
  43.                                     {% if product.hasProductClass %}
  44.                                         {% if product.getPrice02Min == product.getPrice02Max %}
  45.                                             {% set getPrice02NoTaxMin = ceil(product.getPrice02IncTaxMin / 1.1) %}
  46.                                             {{ product.getPrice02IncTaxMin|price }}(税込)/
  47.                                             {{ getPrice02NoTaxMin|price }}(税抜)
  48.                                         {% else %}
  49.                                             {% set getPrice02NoTaxMin = ceil(product.getPrice02IncTaxMin / 1.1) %}
  50.                                             {% set getPrice02NoTaxMax = ceil(product.getPrice02IncTaxMax / 1.1) %}
  51.                                             {{ product.getPrice02IncTaxMin|price }} ~ {{ product.getPrice02IncTaxMax|price }}(税込)/<br>
  52.                                             {{ getPrice02NoTaxMin|price }} ~ {{ getPrice02NoTaxMax|price }}(税抜)
  53.                                         {% endif %}
  54.                                     {% else %}
  55.                                         {% set getPrice02NoTaxMin = ceil(product.getPrice02IncTaxMin / 1.1) %}
  56.                                         {{ product.getPrice02IncTaxMin|price }}(税込)/
  57.                                         {{ getPrice02NoTaxMin|price }}(税抜)
  58.                                     {% endif %}
  59.                                     {% for productClass in product.ProductClasses %}
  60.                                         <p class="ec-newItemRole__listItemPrice">在庫数:{{ productClass.getSaleLimit() }}</p>
  61.                                     {% endfor %}
  62.                                 {% else %}
  63.                                     価格・在庫数:お問い合わせください
  64.                                 {% endif %}
  65.                             </p>
  66.                         </a>
  67.                     </div>
  68.                 {% endfor %}
  69.             </div>
  70.         </div>
  71.     {% endif %}
  72.     {# search box #}
  73.     <div class="d-md-none ec-headerNaviRole__search">
  74.         {{ render(path('block_search_product')) }}
  75.     </div>
  76.     <a class="ec-blockBtn--top btn-center mt-3"  href="{{ url('product_list') }}">販売商品をもっと見る</a>
  77. </div>