{% if Product.RelatedProducts is not empty%}
<script>
$(function () {
$('#RelatedProduct-product_area').appendTo($('.detailWrap-related'));
});
</script>
<div id="RelatedProduct-product_area">
<div class="ttlArea02">
<h2 class="ttl02">関連商品</h2>
<span class="subTxt01">RELATION</span>
</div>
<div class="ec-shelfRole">
<ul class="cardList01">
{% for RelatedProduct in Product.RelatedProducts %}
{% set ChildProduct = RelatedProduct.ChildProduct %}
<li class="card03">
<a href="{{ url('product_detail', {'id': ChildProduct.id}) }}">
{# <div clas="catchphrase">オビテキスト</div> #}
<img src="/html/user_data/dummy.jpg" data-src="{{ asset(ChildProduct.main_list_image|no_image_product, 'save_image') }}" alt="{{ ChildProduct.name }}" class="lazy">
<div class="txtBox">
<div class="flex01">
{% if ChildProduct.ProductClasses.0.SaleType.id == 3 %}
<div class="type bg02">レンタル</div>
{% else %}
<div class="type bg01">販売</div>
{% endif %}
<div class="rightBox">
<h3 class="itemName">{{ ChildProduct.name }}</h3>
<div class="price">
{% if ChildProduct.ProductClasses.0.SaleType.id == 3 %}
<p class="rentalPrice lowPrice">
<span class="tag06">初月費用</span><br class="sp">
<span class="priceTxt">
{% if
ChildProduct.getPrice01Max is defined and
ChildProduct.getPrice01Max is not empty and
(
ChildProduct.getPrice01Min > ChildProduct.getPrice02Min or
ChildProduct.getPrice01Max > ChildProduct.getPrice02Max
)
%}
<span class="defaultPrice">
<span class="defaultPriceInner">
{% if ChildProduct.hasProductClass -%}
{% if ChildProduct.getPrice01Min != ChildProduct.getPrice01Max %}
{{ ChildProduct.getPrice01IncTaxMin|price }}~{{ ChildProduct.getPrice01IncTaxMax|price }}
{% else %}
{{ ChildProduct.getPrice01IncTaxMin|price }}
{% endif %}
{% else %}
{{ ChildProduct.getPrice01IncTaxMin|price }}
{% endif %}
<span class="tax">税込</span>
</span>
</span>
{% endif %}
<span class="salesPrice">
{% if ChildProduct.hasProductClass -%}
{% if ChildProduct.getPrice02Min != ChildProduct.getPrice02Max %}
{{ ChildProduct.getPrice02IncTaxMin|price }}~{{ ChildProduct.getPrice02IncTaxMax|price }}
{% else %}
{{ ChildProduct.getPrice02IncTaxMin|price }}
{% endif %}
{% else %}
{{ ChildProduct.getPrice02IncTaxMin|price }}
{% endif %}
<span class="tax">税込</span>
</span>
</span>
</p>
{% if ChildProduct.ProductClasses.0.getSlnRegularPrice2 is not empty %}
<p class="rentalPrice lowPrice">
<span class="priceTxt">
<span class="tag06 white">2ヶ月目以降</span><br class="sp">
<span class="salesPrice">
{{ (ChildProduct.ProductClasses.0.getSlnRegularPrice2 * 1.1)|price }} <span class="tax">税込/月</span>
</span>
</span>
</p>
{% endif %}
{% else %}
<p class="lowPrice">
{% if ChildProduct.hasProductClass -%}
{% if ChildProduct.getPrice01Min is not null and ChildProduct.getPrice01IncTaxMin == ChildProduct.getPrice01IncTaxMax %}
<span class="priceTxt"><span class="salesPrice">{{ (ChildProduct.getPrice01IncTaxMin)|price }} <span class="tax">税込</span></span></span>
{% elseif ChildProduct.getPrice01Min is not null and ChildProduct.getPrice01Max is not null %}
<span class="priceTxt"><span class="salesPrice">{{ ChildProduct.getPrice01IncTaxMin|price }}~ {{ ChildProduct.getPrice01IncTaxMax|price }} <span class="tax">税込</span></span></span>
{% elseif ChildProduct.getPrice02Min is not null and ChildProduct.getPrice02IncTaxMin == ChildProduct.getPrice02IncTaxMax %}
<span class="priceTxt"><span class="salesPrice">{{ (ChildProduct.getPrice02IncTaxMin)|price }} <span class="tax">税込</span></span></span>
{% elseif ChildProduct.getPrice02Min is not null and ChildProduct.getPrice02Max is not null %}
<span class="priceTxt"><span class="salesPrice">{{ ChildProduct.getPrice02IncTaxMin|price }}~ {{ ChildProduct.getPrice02IncTaxMax|price }} <span class="tax">税込</span></span></span>
{% endif %}
{% else %}
<span class="priceTxt"><span class="salesPrice">{{ ChildProduct.getPrice02IncTaxMin|price }} <span class="tax">税込</span></span></span>
{% endif %}
</p>
{% endif %}
</p>
</div>
</div>
</div>
<div class="spFlex">
{% if ChildProduct.ProductClasses.0.SaleType.id == 3 %}
<div class="type bg02">レンタル</div>
{% else %}
<div class="type bg01">販売</div>
{% endif %}
<ul class="tagList02">
{% if ChildProduct.ProductCategories is not empty %}
{% for ChildProductCategory in ChildProduct.ProductCategories %}
<li>{{ ChildProductCategory.Category.name }}</li>
{% endfor %}
{% endif %}
</ul>
</div>
</div>
</a>
</li>
{% endfor %}
</ul>
</div>
</div>
{% endif %}