custom/plugins/TdsOrlob/src/Resources/views/storefront/component/product/card/box-standard.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/box-standard.html.twig' %}
  2. {% block component_product_box_description %}
  3.     {% set variants = getVariants(product.parentId, context.context) %}
  4. {% endblock %}
  5. {% block component_product_box_rating %}{% endblock %}
  6. {% block component_product_box_badges %}
  7.     {{ parent() }}
  8.     {% if product.categoryTree
  9.         and shopware.config.TdsOrlob.config.salesCategoryId
  10.         and shopware.config.TdsOrlob.config.salesCategoryId in product.categoryTree  %}
  11.         <div class="sales-badge">
  12.             <img src="{{ asset('assets/sales-badge.png', '@TdsOrlob') }}" alt="Sale" class="sales-badge-icon" />
  13.         </div>
  14.     {% endif %}
  15.     {% if product.categoryTree
  16.         and shopware.config.TdsOrlob.config.newCategoryId
  17.         and shopware.config.TdsOrlob.config.newCategoryId in product.categoryTree  %}
  18.         <div class="new-badge">
  19.             <img src="{{ asset('assets/new-badge.png', '@TdsOrlob') }}" alt="New" class="new-badge-icon" />
  20.         </div>
  21.     {% endif %}
  22. {% endblock %}
  23. {% block component_product_box_variant_characteristics %}
  24.     
  25.     <div class="product-productnumber">
  26.         Artikelnummer: <b>
  27.         {% if not variants %}
  28.             {{ product.productNumber }}
  29.         {% else %}
  30.             {% set parent = getProduct(variants|first.parentId, context.context) %}
  31.             {% set parentProductnumber = parent.entities|first.productNumber %}
  32.             {% if parentProductnumber ends with '.' %}
  33.                 {% set parentProductnumber = parentProductnumber|replace({'.': ''}) %}
  34.             {% endif %}
  35.             {{ parentProductnumber }}
  36.         {% endif %}
  37.         </b>
  38.         
  39.     </div>
  40.     
  41. {% endblock %}
  42. {% block component_product_box_price %}
  43.     {{ parent() }}
  44.     
  45.     {% set variants = getVariants(product.parentId, context.context) %}
  46.     
  47.     {% set totalStock = 0 %}
  48.     {% set hasVariants = variants|length > 0 %}
  49.     
  50.     {% for variant in variants %}
  51.         {% set stock = variant.availableStock %}
  52.         {% if stock < 0 %}
  53.             {% set stock = 0 %}
  54.         {% endif %}
  55.         {# StockVariant: {{ stock }} <br> #}
  56.         {% set totalStock = totalStock + stock %}
  57.     {% endfor %}
  58.     
  59.     {% if not hasVariants %}
  60.         {% set totalStock = totalStock + product.stock %}
  61.     {% endif %}
  62.     {# <b>Total Stock: {{ totalStock }}</b> #}
  63. {% endblock %}