app/Plugin/RelatedProduct4/Resource/template/front/related_product.twig line 1

Open in your IDE?
  1. {% if Product.RelatedProducts is not empty%}
  2. <script>
  3.     $(function () {
  4.         $('#RelatedProduct-product_area').appendTo($('.detailWrap-related'));
  5.     });
  6. </script>
  7.     <div id="RelatedProduct-product_area">
  8.         <div class="ttlArea02">
  9.             <h2 class="ttl02">関連商品</h2>
  10.             <span class="subTxt01">RELATION</span>
  11.         </div>
  12.         <div class="ec-shelfRole">
  13.             <ul class="cardList01">
  14.             {% for RelatedProduct in Product.RelatedProducts %}
  15.                 {% set ChildProduct = RelatedProduct.ChildProduct %}
  16.                 <li class="card03">
  17.                     <a href="{{ url('product_detail', {'id': ChildProduct.id}) }}">
  18.                         {# <div clas="catchphrase">オビテキスト</div> #}
  19.                         <img src="/html/user_data/dummy.jpg" data-src="{{ asset(ChildProduct.main_list_image|no_image_product, 'save_image') }}" alt="{{ ChildProduct.name }}" class="lazy">
  20.                         <div class="txtBox">
  21.                             <div class="flex01">
  22.                                 {% if ChildProduct.ProductClasses.0.SaleType.id == 3 %}
  23.                                     <div class="type bg02">レンタル</div>
  24.                                 {% else %}
  25.                                     <div class="type bg01">販売</div>
  26.                                 {% endif %}
  27.                                 <div class="rightBox">
  28.                                     <h3 class="itemName">{{ ChildProduct.name }}</h3>
  29.                                     <div class="price">
  30.                                             {% if ChildProduct.ProductClasses.0.SaleType.id == 3 %}
  31.                                                 <p class="rentalPrice lowPrice">
  32.                                                     <span class="tag06">初月費用</span><br class="sp">
  33.                                                     <span class="priceTxt">
  34.                                                         {% if
  35.                                                             ChildProduct.getPrice01Max is defined and
  36.                                                             ChildProduct.getPrice01Max is not empty and
  37.                                                             (
  38.                                                                 ChildProduct.getPrice01Min > ChildProduct.getPrice02Min or
  39.                                                                 ChildProduct.getPrice01Max > ChildProduct.getPrice02Max
  40.                                                             )
  41.                                                         %}
  42.                                                         <span class="defaultPrice">
  43.                                                             <span class="defaultPriceInner">
  44.                                                                 {% if ChildProduct.hasProductClass -%}
  45.                                                                     {% if ChildProduct.getPrice01Min != ChildProduct.getPrice01Max %}
  46.                                                                         {{ ChildProduct.getPrice01IncTaxMin|price }}~{{ ChildProduct.getPrice01IncTaxMax|price }}
  47.                                                                     {% else %}
  48.                                                                         {{ ChildProduct.getPrice01IncTaxMin|price }}
  49.                                                                     {% endif %}
  50.                                                                 {% else %}
  51.                                                                     {{ ChildProduct.getPrice01IncTaxMin|price }}
  52.                                                                 {% endif %}
  53.                                                                 <span class="tax">税込</span>
  54.                                                             </span>
  55.                                                         </span>
  56.                                                         {% endif %}
  57.                                                         <span class="salesPrice">
  58.                                                             {% if ChildProduct.hasProductClass -%}
  59.                                                                 {% if ChildProduct.getPrice02Min != ChildProduct.getPrice02Max %}
  60.                                                                     {{ ChildProduct.getPrice02IncTaxMin|price }}~{{ ChildProduct.getPrice02IncTaxMax|price }}
  61.                                                                 {% else %}
  62.                                                                     {{ ChildProduct.getPrice02IncTaxMin|price }}
  63.                                                                 {% endif %}
  64.                                                             {% else %}
  65.                                                                 {{ ChildProduct.getPrice02IncTaxMin|price }}
  66.                                                             {% endif %}
  67.                                                             <span class="tax">税込</span>
  68.                                                         </span>
  69.                                                     </span>
  70.                                                 </p>
  71.                                                 {% if ChildProduct.ProductClasses.0.getSlnRegularPrice2 is not empty %}
  72.                                                     <p class="rentalPrice lowPrice">
  73.                                                     <span class="priceTxt">
  74.                                                         <span class="tag06 white">2ヶ月目以降</span><br class="sp">
  75.                                                         <span class="salesPrice">
  76.                                                             {{ (ChildProduct.ProductClasses.0.getSlnRegularPrice2 * 1.1)|price }} <span class="tax">税込/月</span>
  77.                                                         </span>
  78.                                                     </span>
  79.                                                 </p>
  80.                                                 {% endif %}
  81.                                                 {% else %}
  82.                                                 <p class="lowPrice">
  83.                                                     {% if ChildProduct.hasProductClass -%}
  84.                                                         {% if ChildProduct.getPrice01Min is not null and ChildProduct.getPrice01IncTaxMin == ChildProduct.getPrice01IncTaxMax %}
  85.                                                             <span class="priceTxt"><span class="salesPrice">{{ (ChildProduct.getPrice01IncTaxMin)|price }} <span class="tax">税込</span></span></span>
  86.                                                         {% elseif ChildProduct.getPrice01Min is not null and ChildProduct.getPrice01Max is not null %}
  87.                                                             <span class="priceTxt"><span class="salesPrice">{{ ChildProduct.getPrice01IncTaxMin|price }}~ {{ ChildProduct.getPrice01IncTaxMax|price }} <span class="tax">税込</span></span></span>
  88.                                                         {% elseif ChildProduct.getPrice02Min is not null and ChildProduct.getPrice02IncTaxMin == ChildProduct.getPrice02IncTaxMax %}
  89.                                                             <span class="priceTxt"><span class="salesPrice">{{ (ChildProduct.getPrice02IncTaxMin)|price }} <span class="tax">税込</span></span></span>
  90.                                                         {% elseif ChildProduct.getPrice02Min is not null and ChildProduct.getPrice02Max is not null %}
  91.                                                             <span class="priceTxt"><span class="salesPrice">{{ ChildProduct.getPrice02IncTaxMin|price }}~ {{ ChildProduct.getPrice02IncTaxMax|price }} <span class="tax">税込</span></span></span>
  92.                                                         {% endif %}
  93.                                                     {% else %}
  94.                                                             <span class="priceTxt"><span class="salesPrice">{{ ChildProduct.getPrice02IncTaxMin|price }} <span class="tax">税込</span></span></span>
  95.                                                     {% endif %}
  96.                                                 </p>
  97.                                                 {% endif %}
  98.                                             </p>
  99.                                         </div>
  100.                                 </div>
  101.                             </div>
  102.                             <div class="spFlex">
  103.                                 {% if ChildProduct.ProductClasses.0.SaleType.id == 3 %}
  104.                                     <div class="type bg02">レンタル</div>
  105.                                 {% else %}
  106.                                     <div class="type bg01">販売</div>
  107.                                 {% endif %}
  108.                                 <ul class="tagList02">
  109.                                     {% if ChildProduct.ProductCategories is not empty %}
  110.                                         {% for ChildProductCategory in ChildProduct.ProductCategories %}
  111.                                         <li>{{ ChildProductCategory.Category.name }}</li>
  112.                                         {% endfor %}
  113.                                 {% endif %}
  114.                                 </ul>
  115.                             </div>
  116.                         </div>
  117.                     </a>
  118.                 </li>
  119.             {% endfor %}
  120.             </ul>
  121.         </div>
  122.     </div>
  123.     {% endif %}