{% block main %}
<link rel="stylesheet" href="{{ asset('assets/css/hsd_swiper.min.css') }}">
<script src="{{ asset('assets/js/hsd_swiper.min.js') }}"></script>
<style type="text/css">
.hsd_product_img_rp {
width: 100%;
}
.hsd_flex_area_rp {
{% if show_type == 'flip' or show_type == 'cube' %}
display: block;
{% else %}
display: flex;
flex-wrap: wrap;
{% endif %}
}
.hsd_h4 {
padding-left: 15px;
}
</style>
<div class="ec-productRole" id="hsd_related_product_area">
{% if rp_count > 0 %}
<h4 class="hsd_h4">{{ title }}</h4>
{% endif %}
{% set lpc = 1 %}
<div class="hsd_flex_area_rp">
{% if rp_count > 0 and show_type == 'normal' %}
{% for reldat in hsd_related_product %}
{% if max_count >= lpc %}
<div class="col-sm-3 col-xs-6">
<div class="pickup_item">
<a href="{{ url('product_detail', {'id': reldat.id}) }}">
<div class="item_photo"><img src="{{ asset('', 'save_image') }}{{ reldat.file_name | no_image_product }}" class="hsd_product_img_rp" style="width: 100%;" /></div>
<dd class="item_comment">{{ reldat.description_detail|length > 30 ? reldat.description_detail[:30] ~ '...' : reldat.description_detail }}</dd>
<dl>
<dt class="item_name">{{reldat.name}}</dt>
{% if show_price == 'true' %}
{% if reldat.min_price == reldat.max_price %}
{% if calc_rule == 'floor' %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'floor')|number_format(0, '.', ',') }}円</dd>
{% elseif calc_rule == 'ceil' %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'ceil')|number_format(0, '.', ',') }}円</dd>
{% else %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round|number_format(0, '.', ',') }}円</dd>
{% endif %}
{% else %}
{% if calc_rule == 'floor' %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'floor')|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round(0, 'floor')|number_format(0, '.', ',') }}円</dd>
{% elseif calc_rule == 'ceil' %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'ceil')|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round(0, 'ceil')|number_format(0, '.', ',') }}円</dd>
{% else %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round|number_format(0, '.', ',') }}円</dd>
{% endif %}
{% endif %}
{% endif %}
</dl>
</a>
</div>
</div>
{% endif %}
{% set lpc = lpc + 1 %}
{% endfor %}
{% else %}
{% if rp_count > 0 %}
<div class="swiper-container">
<div class="swiper-wrapper">
{% for reldat in hsd_related_product %}
{% if max_count >= lpc %}
<div class="swiper-slide">
<div class="pickup_item">
<a href="{{ url('product_detail', {'id': reldat.id}) }}">
<div class="item_photo"><img src="{{ asset('', 'save_image') }}{{ reldat.file_name | no_image_product }}" style="width: 100%;" /></div>
<dd class="item_comment">{{ reldat.description_detail|length > 30 ? reldat.description_detail[:30] ~ '...' : reldat.description_detail }}</dd>
<dl>
<dt class="item_name">{{reldat.name}}</dt>
{% if show_price == 'true' %}
{% if reldat.min_price == reldat.max_price %}
{% if calc_rule == 'floor' %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'floor')|number_format(0, '.', ',') }}円</dd>
{% elseif calc_rule == 'ceil' %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'ceil')|number_format(0, '.', ',') }}円</dd>
{% else %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round|number_format(0, '.', ',') }}円</dd>
{% endif %}
{% else %}
{% if calc_rule == 'floor' %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'floor')|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round(0, 'floor')|number_format(0, '.', ',') }}円</dd>
{% elseif calc_rule == 'ceil' %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round(0, 'ceil')|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round(0, 'ceil')|number_format(0, '.', ',') }}円</dd>
{% else %}
<dd class="item_price">{{ (reldat.min_price * reldat.tax)|round|number_format(0, '.', ',') }}円 〜 {{ (reldat.max_price * reldat.tax2)|round|number_format(0, '.', ',') }}円</dd>
{% endif %}
{% endif %}
{% endif %}
</dl>
</a>
</div>
</div>
{% endif %}
{% set lpc = lpc + 1 %}
{% endfor %}
</div>
{% if pagination == 'true' %}
<div class="swiper-pagination"></div>
{% endif %}
{% if navbuttons == 'true' %}
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
{% endif %}
</div>
{% endif %}
{% endif %}
</div>
</div>
{% if rp_count > 0 %}
{% if show_type == 'flip' or show_type == 'cube' %}
<style>
#hsd_related_product_area .swiper-container {
margin: 0 20px;
}
</style>
{% elseif show_type == 'coverflow' %}
<style>
#hsd_related_product_area .swiper-slide {
background-position: center;
background-size: cover;
width: 200px;
}
</style>
{% endif %}
{% endif %}
<script>
var swiper = new Swiper('#hsd_related_product_area .swiper-container', {
pagination: '#hsd_related_product_area .swiper-pagination',
prevButton: '#hsd_related_product_area .swiper-button-prev',
nextButton: '#hsd_related_product_area .swiper-button-next',
paginationClickable: true,
{% if rp_count > 0 and showloop == 'true' %}
autoplay: 2500,
{% else %}
autoplay: 0,
{% endif %}
{% if rp_count > 0 and show_type == 'per3' %}
slidesPerView: 3.75,
spaceBetween: 20,
breakpoints: {
// スライドの表示枚数:768px以上の場合
768: {
slidesPerView: 2.25,
}
},
{% elseif rp_count > 0 and show_type == 'per4' %}
slidesPerView: 4.75,
spaceBetween: 20,
breakpoints: {
// スライドの表示枚数:768px以上の場合
768: {
slidesPerView: 2.25,
}
},
{% elseif rp_count > 0 and show_type == 'per5' %}
slidesPerView: 5.75,
spaceBetween: 20,
breakpoints: {
// スライドの表示枚数:768px以上の場合
768: {
slidesPerView: 2.25,
}
},
{% elseif rp_count > 0 and show_type == 'flip' %}
effect: 'flip',
grabCursor: true,
{% elseif rp_count > 0 and show_type == 'cube' %}
effect: 'cube',
grabCursor: true,
cube: {
shadow: true,
slideShadows: true,
shadowOffset: 20,
shadowScale: 0.94
},
{% elseif rp_count > 0 and show_type == 'coverflow' %}
effect: 'coverflow',
grabCursor: true,
centeredSlides: true,
slidesPerView: 'auto',
coverflow: {
rotate: 50,
stretch: 0,
depth: 100,
modifier: 1,
slideShadows : true
},
{% endif %}
});
{% if rp_count > 0 and showloop == 'false' %}
swiper.autoplay.stop();
{% endif %}
</script>
{% endblock %}