app/template/default/Block/refine_check_item.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of Refine
  3. Copyright(c) 2021 Refine Co.,Ltd. All Rights Reserved.
  4. https://www.re-fine.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% if Products %}
  9. <section id="common_check_block">
  10.     <div class="home_title__inner">
  11.         <h2 class="home_ja_title">最近チェックした商品</h2>
  12.     </div><!--/.home_title__inner-->
  13.     <div class="common_check__inner">
  14.     <ul class="common_check_list">
  15.         {% for ProductArray in Products  %}
  16.             {% if loop.index <= 4 %}
  17.             {% set product = ProductArray.Product %}
  18.             {% set hasStock = ProductArray.hasStock %}
  19.             <li class="check_list_block">
  20.                 <a href="{{ url('product_detail', {'id': product.id}) }}">
  21.                     <div class="thumb">
  22.                         <img src="{{ asset(product.main_list_image|no_image_product, 'save_image') }}" alt="{{ product.name }}" {% if loop.index > 5 %} loading="lazy"{% endif %}>
  23.                     </div><!--/.thumb-->
  24.                     {# 商品が所属する特定の親カテゴリの子カテゴリを取得します #}
  25.                     {% set targetParentCategoryId = 34 %} {# 親カテゴリのIDを指定 #}
  26.                     {% set relatedSubcategories = [] %}
  27.                     {% for productCategory in product.ProductCategories %}
  28.                         {% set category = productCategory.Category %}
  29.                         {% if category.Parent and category.Parent.id == targetParentCategoryId %}
  30.                             {% set relatedSubcategories = relatedSubcategories|merge([category]) %}
  31.                         {% endif %}
  32.                     {% endfor %}
  33.                     <div class="pickup_list_block__txt">
  34.                         {# 商品が所属する特定の親カテゴリの子カテゴリを表示します #}
  35.                         {% for subcategory in relatedSubcategories %}
  36.                             <object>
  37.                                 <a class="brand_name" href="{{ url('product_list', {'category_id': subcategory.id}) }}">
  38.                                     {{ subcategory.name }}
  39.                                 </a>
  40.                             </object>
  41.                         {% endfor %}
  42.                         <span class="product_ttl">{{ product.name }}</span>
  43.                         <span class="product_price">
  44.                                     <span class="product_price__num">
  45.                                     {% if product.hasProductClass %}
  46.                                         {% if product.getPrice02Min == product.getPrice02Max %}
  47.                                             {{ product.getPrice02IncTaxMin|price }}
  48.                                         {% else %}
  49.                                             {{ product.getPrice02IncTaxMin|price }} ~ {{ product.getPrice02IncTaxMax|price }}
  50.                                         {% endif %}
  51.                                     {% else %}
  52.                                         {{ product.getPrice02IncTaxMin|price }}
  53.                                     {% endif %}
  54.                                     </span><!--/.product_price__num-->
  55.                                     <span class="zeikomi">(税込)</span>
  56.                                 </span>
  57.                     </div><!--/.pickup_list_block__txt-->
  58.                 </a>
  59.             </li>
  60.             {% endif %}
  61.         {% endfor %}
  62.     </ul>
  63.     </div><!--/.home_pickup__inner-->
  64. </section><!--/#home_check-->
  65. {% endif %}
  66. {#
  67.     <div class="ec-shelfRole">
  68.         <h2 class="ec-headingTitle">{{ 'refine_check_item.check_item'|trans }}</h2>
  69.         <ul class="ec-shelfGrid">
  70.             {% for ProductArray in Products  %}
  71.                 {% set Product = ProductArray.Product %}
  72.                 {% set hasStock = ProductArray.hasStock %}
  73.                 <li class="ec-shelfGrid__item">
  74.                     <a href="{{ url('product_detail', {'id': Product.id}) }}">
  75.                         <img src="{{ asset(Product.main_list_image|no_image_product, "save_image") }}" alt="{{ Product.name }}">
  76.                         <dl>
  77.                             <dt class="item_name">{{ Product.name }}</dt>
  78.                             <dd class="item_price">
  79.                                 {% if Product.hasProductClass %}
  80.                                     {% if Product.getPrice02Min == Product.getPrice02Max %}
  81.                                         {{ Product.getPrice02IncTaxMin|price }}
  82.                                     {% else %}
  83.                                         {{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}
  84.                                     {% endif %}
  85.                                 {% else %}
  86.                                     {{ Product.getPrice02IncTaxMin|price }}
  87.                                 {% endif %}
  88.                             </dd>
  89.                             <dd>
  90.                                 {% if hasStock %}
  91.                                     {{ 'refine_check_item.has_stock'|trans }}
  92.                                 {% else %}
  93.                                     {{ 'refine_check_item.no_stock'|trans }}
  94.                                 {% endif %}
  95.                             </dd>
  96.                         </dl>
  97.                     </a>
  98.                 </li>
  99.             {% endfor %}
  100.         </ul>
  101.     </div>
  102. #}