{% sw_extends '@Storefront/storefront/component/product/card/box.html.twig' %}
{# ThemeWare® HC-Architecture® ready #}
{# ThemeWare: Adjustments on the product box #}
{% block component_product_box_include %}
{# ThemeWare: Klasse 'twt-is-sold' hinzufügen falls "Produkte nach Abverkaufende abschwächen" aktiviert wurde. #}
{# TODO: Check if adding as class to product boxes will be made possible in further Shopware updates #}
{% if product.isCloseout and product.availableStock < product.minPurchase and not product.isGrouped %}
{% set twtBlockClasses = ['twt-is-sold'] %}
{% endif %}
{# ThemeWare: Klasse 'twt-is-topseller' hinzufügen falls das Produkt ein "Topseller" ist. #}
{# TODO: Check if adding as class to product boxes will be made possible in further Shopware updates #}
{% if product.markAsTopseller and twtBlockClasses is not empty %}
{% set twtBlockClasses = ['twt-is-topseller']|merge(twtBlockClasses) %}
{% elseif product.markAsTopseller and twtBlockClasses is empty %}
{% set twtBlockClasses = ['twt-is-topseller'] %}
{% endif %}
{% if twtBlockClasses is not empty %}
<div class="{{ twtBlockClasses|join(' ') }}"></div>
{% endif %}
{# Default block #}
{{ parent() }}
{% endblock %}