{% set categoryId = app.request.get('category').id|default %}
<div class="econda-slider econda-slider--hide {{ class|default }}" data-econda-identifer="{{ econdaContentIdentifier|default(_uid|default) }}">
{% set product = {
'name': '[[record.name]]',
'master': {
'displaySku': '[[record.id]]',
'links': {
'webshop': '#[[record.deeplink]]'
}
}
} %}
{% set sliderProducts = [product] %}
{% embed 'components/organisms/product-slider/product-slider.html.twig' with {
'attributes': {'data-is-econda': 'true'},
}%}
{% block sliderSlides %}
<div class="product-slider__wrapper swiper-wrapper">
<div class="product-slider__slider swiper-slide econda-template" data-imageservice-base-url="{{ imageservice }}">
{% embed 'components/molecules/product-box/product-box.html.twig' with {
'class': ' product-box--slider',
} %}
{% block productBoxBadges %}
<div class="product-box__badges ">
{% include 'components/atoms/badge/badge.html.twig' with {
'class': 'badge--new badge--with-background econda-slider__new--hide',
'content': 'product_badge_new' | trans
} %}
{% include 'components/atoms/badge/badge.html.twig' with {
'class': 'badge--sale badge--with-background econda-slider__sale--hide',
'content': 'SALE'
} %}
</div>
{% endblock %}
{% block productBoxImage %}
<div class="product-box__image-box">
{% include 'components/atoms/image/image.html.twig' with {
'class': 'product-box__image product_ssss',
'strict': true,
'lazyload': true
} %}
</div>
{% endblock %}
{% block productBoxTextBadge %}
<div class="product-box__text-badge">
{% include 'components/atoms/badge/badge.html.twig' with {
'class': 'badge--text econda-slider__bestseller--hide',
'content': 'bestseller'|trans
} %}
</div>
{% endblock %}
{% block productBoxTitle %}
<div class="product-box__title">
<span>[[record.name]]</span>
</div>
{% endblock %}
{% block productBoxPrices %}
<div class="product-box__price">
<div class="econda-slider__price econda-slider__price--hide">
<span class="econda-slider__action-price--hide econda-slider__action-price" data-layer-price="[[record.price]]" data-layer-currency="{{ 0|currencyCode }}">
[[record.actionPrice]]
</span>
<span class="econda-slider__price--old econda-slider__action-price--hide">
[[record.price]]
</span>
<span class="econda-slider__normal-price--hide">
[[record.price]]
</span>
<span class="econda-slider__price-tax">
{{ app.request.attributes.getBoolean('exclude_vat') ? 'header_vat_excluding'|trans : 'header_vat_including'|trans }}
</span>
</div>
<span class="product-box__price-on-request econda-slider__price-on-request--hide" >{{'price_on_request'|trans}}</span>
{% block productBoxAction %}
<div class="econda-slider__shopping-list-icon--hide">
<a class="js-add-to-shopping-list"
href="#"
aria-label="{{ 'shopping_list_add'|trans }}"
data-product-id="[[record.productId]]"
data-variant-id="[[record.variantId]]"
data-shopping-list-icon=""
data-shopping-list-success-icon="icon--pin-fill" >
<i class="icon icon--pin"></i>
</a>
</div>
{% endblock%}
</div>
{% endblock %}
{% endembed %}
</div>
</div>
{% endblock %}
{% endembed %}
</div>
<script data-cookie-type="econda-slider" type="application/javascript">
window.econda.ready(() => {
if (typeof econdaConfig !== 'undefined') {
econdaConfig.crosssellAccountId = "{{ 'econda_account_id'|trans }}";
let econdaElement = document.querySelector('[data-econda-identifer="{{ econdaContentIdentifier|default(_uid|default) }}"]');
if (econdaElement != null) {
let econdaSlider = econdaElement.querySelector('.product-slider__wrapper');
const widget = new econda.recengine.Widget({
element: econdaSlider,
renderer: {
type: 'function',
rendererFn: window.dataStore.econdaTemplate
},
afterRender: window.dataStore.econdaAfterRender,
id : {{ widgetId|default(1) }},
removeIfEmpty: true,
emptyThreshold: 1,
context: {
{% if econdaProductId is defined %}
{% if econdaProductId is iterable %}
products: [
{% for product in econdaProductId %}
{id: '{{ product.sku }}'+'W' },
{% endfor %}
],
{% else %}
products: [{id: "{{ econdaProductId }}" }],
{% endif %}
{% endif %}
{% if categoryId is defined and categoryId is not empty %}
categories:{
type: 'productcategory',
id: '{{ categoryId }}'
}
{% endif %}
},
});
widget.econdaElement = econdaElement;
widget.render();
econdaElement.removeAttribute('data-econda-identifer');
}
};
});
</script>