{#
This file is part of Refine
Copyright(c) 2021 Refine Co.,Ltd. All Rights Reserved.
https://www.re-fine.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
<script>
$(function () {
$('#refine-check-item').appendTo($('#js-checked-area'));
if (window.matchMedia( '(min-width: 768px)' ).matches) {
if($('#js-checked-slider').find('.p-product-checked__slide').length<=4){
$('#js-checked-slider').addClass('no-slide');
} else {
$('#js-checked-slider').slick({
autoplay: false,
arrows: true,
dots:false,
slidesToShow: 4,
});
}
} else {
if($('#js-checked-slider').find('.p-product-checked__slide').length<=1){
$('#js-checked-slider').addClass('no-slide');
} else {
$('#js-checked-slider').slick({
autoplay: false,
arrows: false,
dots:false,
centerMode: true,
centerPadding: '10%',
});
}
}
});
</script>
{% if Products %}
<div class="p-product-checked__container" id="refine-check-item">
<h2 class="p-product-checked__ttl c-ttl-sec">
<span class="jp">最近チェックした商品</span>
<span class="en">CHECKED PRODUCTS</span>
</h2>
<div class="p-product-checked__slider" id="js-checked-slider">
{% for ProductArray in Products %}
{% set Product = ProductArray.Product %}
{% set hasStock = ProductArray.hasStock %}
{% set group1 = repository("Plugin\\CustomerGroup42\\Entity\\Group").find(1) %}
{% set group2 = repository("Plugin\\CustomerGroup42\\Entity\\Group").find(2) %}
{% set group3 = repository("Plugin\\CustomerGroup42\\Entity\\Group").find(3) %}
{% set group4 = repository("Plugin\\CustomerGroup42\\Entity\\Group").find(4) %}
{% if group1 is not null and is_granted('view', group1) or group2 is not null and is_granted('view', group2) or group3 is not null and is_granted('view', group3) or group4 is not null and is_granted('view', group4) %} {# ヒートセラピー会員 ログイン時 #}
<div class="p-product-checked__slide">
<a href="{{ url('product_detail', {'id': Product.id}) }}" class="p-product-checked__slide-link">
<div class="p-product-checked__slide-img-wrap">
<img src="{{ asset(Product.main_list_image|no_image_product, "save_image") }}" alt="{{ Product.name }}">
</div>
<h3 class="p-product-checked__slide-ttl">{{ Product.name }}</h3>
</a>
</div>
{% else %} {# ヒートセラピー会員 非ログイン時 #}
{% if Product.ProductCategories[0] is not defined or Product.ProductCategories[0] is defined and Product.ProductCategories[0].category_id != 10 %}
<div class="p-product-checked__slide">
<a href="{{ url('product_detail', {'id': Product.id}) }}" class="p-product-checked__slide-link">
<div class="p-product-checked__slide-img-wrap">
<img src="{{ asset(Product.main_list_image|no_image_product, "save_image") }}" alt="{{ Product.name }}">
</div>
<h3 class="p-product-checked__slide-ttl">{{ Product.name }}</h3>
</a>
</div>
{% endif %}
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}