<script>
$(function () {
$('#related_product_area').appendTo($('#item_detail'));
$('.related_product_carousel').slick({
infinite: false,
speed: 300,
prevArrow:'<button type="button" class="slick-prev"><span class="angle-circle"><svg class="cb cb-angle-right"><use xlink:href="#cb-angle-right" /></svg></span></button>',
nextArrow:'<button type="button" class="slick-next"><span class="angle-circle"><svg class="cb cb-angle-right"><use xlink:href="#cb-angle-right" /></svg></span></button>',
slidesToShow: 4, // 一画面に表示する関連商品の数
slidesToScroll: 4, // スクロール時に移動する関連商品の数
responsive: [
{
breakpoint: 768,
settings: {
slidesToShow: 3, // (スマホ画面)一画面に表示する関連商品の数
slidesToScroll: 3 // (スマホ画面)スクロール時に移動する関連商品の数
}
}
]
});
});
</script>
<div id="related_product_area" class="row">
<div class="col-sm-12">
<h2 class="heading03">関連商品</h2>
<div class="related_product_carousel">
{% for RelatedProduct in Product.RelatedProducts %}
{% set ChildProduct = RelatedProduct.ChildProduct %}
{% if ChildProduct.Status.id == constant("Eccube\\Entity\\Master\\ProductStatus::DISPLAY_SHOW") %}
<div class="product_item">
<a href="{{ url('product_detail', {id : ChildProduct.id}) }}">
<div class="item_photo">
<img src="{{ asset(RelatedProduct.ChildProduct.main_list_image|no_image_product, 'save_image') }}">
</div>
<dl>
<dt class="item_name">{{ RelatedProduct.ChildProduct.name }}</dt>
<dd class="item_price">
{% if RelatedProduct.ChildProduct.hasProductClass %}
{% if RelatedProduct.ChildProduct.getPrice02Min == RelatedProduct.ChildProduct.getPrice02Max %}
{{ RelatedProduct.ChildProduct.getPrice02IncTaxMin|price }}<small>(税込)</small>
{% else %}
{{ RelatedProduct.ChildProduct.getPrice02IncTaxMin|price }}<small>(税込)</small> ~ {{ RelatedProduct.ChildProduct.getPrice02IncTaxMax|price }}<small>(税込)</small>
{% endif %}
{% else %}
{{ RelatedProduct.ChildProduct.getPrice02IncTaxMin|price }}<small>(税込)</small>
{% endif %}
</dd>
<dd class="item_comment">{{ RelatedProduct.content|raw|purify }}</dd>
</dl>
</a>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>