app/template/temptu/Block/related_product.twig line 1

Open in your IDE?
  1. {#
  2. 関連商品ブロック(RelatedProductController から Products が渡されます)
  3. 商品詳細ページでは同一カテゴリの商品、それ以外では新着順の商品を表示
  4. ※ブロック管理で「コントローラーを使用」が有効である必要があります
  5. #}
  6. {% if Products is defined and Products|length > 0 %}
  7. <div class="ec-role" style="margin-top:30px">
  8.     <div class="ec-secHeading">
  9.         <span class="ec-secHeading__en">Recommend Items</span>
  10.         <span class="ec-secHeading__line"></span>
  11.         <span class="ec-secHeading__ja">関連商品</span>
  12.     </div>
  13.     <ul class="ec-shelfGrid">
  14.         {% for Product in Products|default([]) %}
  15.             <li class="ec-shelfGrid__item">
  16.                 <a href="{{ url('product_detail', {'id': Product.id}) }}">
  17.                     <img src="{{ asset(Product.mainFileName|no_image_product, 'save_image') }}" alt="{{ Product.name }}">
  18.                     <p class="ec-shelfGrid__item-title">{{ Product.name }}</p>
  19.                     <p class="ec-shelfGrid__item-price">
  20.                         {% if Product.hasProductClass %}
  21.                             {% if Product.getPrice02Min == Product.getPrice02Max %}
  22.                                 {{ Product.getPrice02IncTaxMin|price }}
  23.                             {% else %}
  24.                                 {{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
  25.                             {% endif %}
  26.                         {% else %}
  27.                             {{ Product.getPrice02IncTaxMin|price }}
  28.                         {% endif %}
  29.                         <span class="ec-price__tax">{{ '税込'|trans }}</span>
  30.                     </p>
  31.                 </a>
  32.             </li>
  33.         {% endfor %}
  34.     </ul>
  35. </div>
  36. {% endif %}