{% sw_extends '@Storefront/storefront/component/product/card/box-standard.html.twig' %}
{% block component_product_box_description %}
{% set variants = getVariants(product.parentId, context.context) %}
{% endblock %}
{% block component_product_box_rating %}{% endblock %}
{% block component_product_box_badges %}
{{ parent() }}
{% if product.categoryTree
and shopware.config.TdsOrlob.config.salesCategoryId
and shopware.config.TdsOrlob.config.salesCategoryId in product.categoryTree %}
<div class="sales-badge">
<img src="{{ asset('assets/sales-badge.png', '@TdsOrlob') }}" alt="Sale" class="sales-badge-icon" />
</div>
{% endif %}
{% if product.categoryTree
and shopware.config.TdsOrlob.config.newCategoryId
and shopware.config.TdsOrlob.config.newCategoryId in product.categoryTree %}
<div class="new-badge">
<img src="{{ asset('assets/new-badge.png', '@TdsOrlob') }}" alt="New" class="new-badge-icon" />
</div>
{% endif %}
{% endblock %}
{% block component_product_box_variant_characteristics %}
<div class="product-productnumber">
Artikelnummer: <b>
{% if not variants %}
{{ product.productNumber }}
{% else %}
{% set parent = getProduct(variants|first.parentId, context.context) %}
{% set parentProductnumber = parent.entities|first.productNumber %}
{% if parentProductnumber ends with '.' %}
{% set parentProductnumber = parentProductnumber|replace({'.': ''}) %}
{% endif %}
{{ parentProductnumber }}
{% endif %}
</b>
</div>
{% endblock %}
{% block component_product_box_price %}
{{ parent() }}
{% set variants = getVariants(product.parentId, context.context) %}
{% set totalStock = 0 %}
{% set hasVariants = variants|length > 0 %}
{% for variant in variants %}
{% set stock = variant.availableStock %}
{% if stock < 0 %}
{% set stock = 0 %}
{% endif %}
{# StockVariant: {{ stock }} <br> #}
{% set totalStock = totalStock + stock %}
{% endfor %}
{% if not hasVariants %}
{% set totalStock = totalStock + product.stock %}
{% endif %}
{# <b>Total Stock: {{ totalStock }}</b> #}
{% endblock %}