{% sw_extends '@Storefront/storefront/element/cms-element-product-slider.html.twig' %}
{% block element_product_slider %}
{% if not sliderConfig %}
{% set sliderConfig = element.fieldConfig.elements %}
{% endif %}
{% set gallerySliderOptions = {
"mobileFirst": true,
"variableWidth": true,
"responsive": [
{
"breakpoint": 1,
"settings": "unslick"
},
{
"breakpoint": 1023,
"settings": {
"dots": false,
"arrows": false,
"infinite": false,
"slidesToShow": 4,
}
}
]
} %}
{% if sliderConfig.navigation.value %}
{% set gallerySliderOptions = gallerySliderOptions|replace_recursive({
"arrows": true,
"prevArrow": "#prev-slide-"~element.id,
"nextArrow": "#next-slide-"~element.id,
}) %}
{% endif %}
{% if element.data.products.elements %}
<div class="cms-element-{{ element.type }}{% if sliderConfig.displayMode.value == "standard" and sliderConfig.verticalAlign.value %} has-vertical-alignment{% endif %}">
{% block element_product_slider_alignment %}
{% block element_product_slider_slider %}
<div class="product-slider{% if sliderConfig.navigation.value %} has-nav{% endif %}">
{% block element_product_slider_title %}
{% if sliderConfig.title.value %}
<div class="product-slider-title boxed-layout h2 mb-3">
{{ sliderConfig.title.value }}
</div>
{% endif %}
{% endblock %}
{% block element_product_slider_controls %}
{% if sliderConfig.navigation.value %}
<div class="custom-slick-control flex grid-gap-2 justify-end hidden lg:flex boxed-layout">
<button id="prev-slide-{{ element.id }}"
class="products-back flex p-1 transition duration-300 active:-translate-x-0.5 hover:-translate-x-0.5">
{% sw_icon 'arrow-head-left' %}
</button>
<button id="next-slide-{{ element.id }}"
class="products-next flex p-1 transition duration-300 active:translate-x-0.5 hover:translate-x-0.5">
{% sw_icon 'arrow-head-right' %}
</button>
</div>
{% endif %}
{% endblock %}
{% block element_product_slider_inner %}
{% block element_product_slider_element %}
<div class="product-slider-container slick-init slick-after-lg slick-swipe-mobile slick-padding-boxed-layout"
data-slick='{{ gallerySliderOptions|json_encode }}'>
{% for product in element.data.products.elements %}
{% block element_product_slider_inner_item %}
<div class="product-slider-item !w-[232px] md:!w-[264px] mr-2">
{% sw_include '@Storefront/storefront/component/product/card/box.html.twig' with {
'layout': sliderConfig.boxLayout.value,
'displayMode': sliderConfig.displayMode.value
} %}
</div>
{% endblock %}
{% endfor %}
<div class="product-slider-item">
</div>
<div class="product-slider-item">
</div>
</div>
{% endblock %}
{% endblock %}
</div>
{% endblock %}
{% endblock %}
</div>
{% endif %}
{% endblock %}