app/template/airconwork/Module/comparison.twig line 1

Open in your IDE?
  1. <ul class="c-list-link-01">
  2. {% set flag = 'false' %}
  3. {% for product in Comparison %}
  4.   {% set shape_id = null %}
  5.   {% set power_id = null %}
  6.   {% set system_id = null %}
  7.   {# 商品のカテゴリから形状ID・馬力ID・システムIDを抽出 #}
  8.   {% for ProductCategory in product.ProductCategories %}
  9.     {% if ProductCategory.Category.getParent and ProductCategory.Category.getParent.id == 51 %}
  10.       {% set shape_id = ProductCategory.Category.id %}
  11.     {% elseif ProductCategory.Category.getParent and ProductCategory.Category.getParent.id == 61 %}
  12.       {% set power_id = ProductCategory.Category.id %}
  13.     {% elseif ProductCategory.Category.getParent and ProductCategory.Category.getParent.id == 81 %}
  14.       {% set system_id = ProductCategory.Category.id %}
  15.     {% endif %}
  16.   {% endfor %}
  17.   {# 条件に合致する商品だけ表示(メーカー + 形状 + 馬力 + システム) #}
  18.   {% if shape_id == CatShapeId and power_id == CatPowerId and system_id == CatSystemId %}
  19.     {% for ProductCategory in product.ProductCategories %}
  20.       {% if ProductCategory.Category.id == cid and product.code_min != ProductCode %}
  21.         <li>
  22.           <a href="/products/detail/{{ product.id }}?shape={{ CatShapeId }}&power={{ CatPowerId }}&system={{ CatSystemId }}">
  23.             {{ product.code_min }}
  24.           </a>
  25.         </li>
  26.         {% set flag = 'true' %}
  27.       {% endif %}
  28.     {% endfor %}
  29.   {% endif %}
  30. {% endfor %}
  31. {% if flag == 'false' %}
  32.   <li>該当なし</li>
  33. {% endif %}
  34. </ul>