{% sw_extends '@Storefront/storefront/element/cms-element-cross-selling.html.twig' %}
{% block cms_element_cross_selling_tabs_content_container %}
<div class="tab-content">
{% for item in element.data.crossSellings.elements|filter(item => item.total > 0 and item.crossSelling.active == true) %}
{% set crossSelling = item.crossSelling %}
{% set products = item.products %}
{% set id = crossSelling.id %}
{% set crossSellingComparable = item.crossSelling.extensions.crossSellingComparable %}
{% if crossSellingComparable and crossSellingComparable.isComparable %}
{% set page = {
products: products,
properties: crossSelling.extensions.compareProperties
} %}
<div class="tab-pane fade show{% if loop.first %} active{% endif %}"
id="cs-{{ id }}-tab-pane"
role="tabpanel"
aria-labelledby="cs-{{ id }}-tab">
<span class="hidden" data-product-slider="true"></span>
{% sw_include '@Storefront/storefront/component/compare/content.html.twig' with {
page: page
} %}
</div>
{% else %}
<div class="tab-pane fade show{% if loop.first %} active{% endif %}"
id="cross-selling-tab-{{ id }}-pane"
role="tabpanel"
aria-labelledby="cross-selling-tab-{{ id }}">
{% set config = {
'title': {
'value': crossSelling.name ?: crossSelling.translated.name
},
'border': {
'value': false
},
'rotate': {
'value': false
},
'products': {
'value': products
},
'boxLayout': {
'value': sliderConfig.boxLayout.value
},
'elMinWidth': {
'value': sliderConfig.elMinWidth.value
},
'navigation': {
'value': true
},
'displayMode': {
'value': sliderConfig.displayMode.value
},
'verticalAlign': {
'value': center
}
} %}
{% block cms_element_cross_selling_tabs_content_container_slider %}
{% sw_include "@Storefront/storefront/element/cms-element-product-slider.html.twig" with {
sliderConfig: config,
element: {
'data': {
'products': products
},
type: 'product-slider'
}
} %}
{% endblock %}
</div>
{% endif %}
{% endfor %}
</div>
{% endblock %}