<article class="product-box product-box--product {% if class is defined %}{{ class }}{% endif %}">
<div class="product-box__inner">
<header class="product-box__header">
{% if product.categories.first is defined %}
<a href="{{ path('efShowProduct', {
categorySlug: product.getParentCategorySlug,
categoryChildSlug: product.getCategorySlug,
productAssociationSlug: product.slug
}) }}"
title="{{ product.title }}">
{% if product.productImages is not empty %}
<img class="product-box__thumbnail product-box__image"
src="{{ vich_uploader_asset(product.productImages[0], 'imageFile') }}"
alt=""
>
{% endif %}
</a>
{% endif %}
</header>
<footer class="product-box__footer">
{% if product.title is not empty %}
<h2 class="product-box__title">{{ product.title }}</h2>
{% endif %}
{% if product.categories.first is not empty %}
<h3 class="product-box__category">{{ product.categories.first.categoryName }}</h3>
{% endif %}
{% if product.frontendDescriptionShort is not empty %}
<p class="product-box__paragraph visible-xs">
{{ product.frontendDescriptionShort }}
</p>
{% elseif product.frontendDescription is not empty %}
<p class="product-box__paragraph visible-xs">
{{ product.frontendDescription }}
</p>
{% endif %}
{% if product.categories.first is not empty %}
<footer class="product-box__description-footer visible-xs">
<a class="product-box__link" href="{{ path('efShowProduct', {
categorySlug: product.getParentCategorySlug,
categoryChildSlug: product.getCategorySlug,
productAssociationSlug: product.slug
}) }}">
Zobacz więcej
</a>
</footer>
{% endif %}
</footer>
<div class="product-box__overlay">
<button class="button button--white button--thin product-box__preview jsToggleProductPreview"
data-url="{{ path('efProductPreview', {
'productAssociationId': product.id,
'type': 'product'
}) }}"
>
Szybki podgląd
</button>
<div class="product-box__description {% if kcShortDesc is defined %}product-box__description--short{% endif %}">
{% if product.categories.first is not empty %}
<h3 class="product-box__category">{{ product.categories.first.categoryName }}</h3>
{% endif %}
{% if product.title is not empty %}
<h2 class="product-box__title">{{ product.title }}</h2>
{% endif %}
{% if product.frontendDescriptionShort is not empty %}
<p class="product-box__paragraph">
{% set productShortWordsArray = product.frontendDescriptionShort|split(' ') %}
{% if productShortWordsArray|length > 20 %}
{{ productShortWordsArray|slice(0, 20)|join(' ') }}
{% else %}
{{ productShortWordsArray|join(' ') }}
{% endif %}
</p>
{% elseif product.frontendDescription is not empty %}
<p class="product-box__paragraph">
{% set productWordsArray = product.frontendDescription|split(' ') %}
{% if productWordsArray|length > 20 %}
{{ productWordsArray|slice(0, 20)|join(' ') }}
{% else %}
{{ productWordsArray|join(' ') }}
{% endif %}
</p>
{% endif %}
{% if product is not empty %}
<footer class="product-box__description-footer">
<a class="product-box__link" href="{{ path('efShowProduct', {
categorySlug: product.getParentCategorySlug,
categoryChildSlug: product.getCategorySlug,
productAssociationSlug: product.slug
}) }}">
Zobacz więcej
</a>
</footer>
{% endif %}
</div>
</div>
</div>
</article>