custom/static-plugins/NdVoorwindenTheme/src/Resources/views/storefront/component/product/card/price-unit.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/product/card/price-unit.html.twig' %}
  2. {% block component_product_box_price %}
  3.     <div class="product-price-wrapper">
  4.         {# Custom switch, this is made for Shop The Look products. As Shop #}
  5.         {% if product.calculatedPrice %}
  6.             {# Original prices, default shopware #}
  7.             {% set price = real %}
  8.             {% set isListPrice = price.listPrice.percentage > 0 %}
  9.             {% set unitPrice = price.unitPrice %}
  10.             {% set listPrice = price.listPrice.price %}
  11.         {% else %}
  12.             {# Custom prices, for products that are included by Shop The Look #}
  13.             {% set price = product.price.elements|first %}
  14.             {% set isListPrice = price.gross < price.listPrice.gross %}
  15.             {% set unitPrice = price.gross %}
  16.             {% set listPrice = price.listPrice.gross %}
  17.         {% endif %}
  18.         {% if displayFrom %}
  19.             {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  20.         {% endif %}
  21.         {% if isListPrice and not displayFrom %}
  22.             <span class="list-price original-price text-xs lg:text-sm line-through mr-1 md:mr-2">
  23.                     {{ listPrice|number_format(2, ',', '')|replace({',00': ',-'}) }}
  24.             </span>
  25.         {% endif %}
  26.         <span class="product-price current-price inline-block text-xs lg:text-sm{% if isListPrice and not displayFrom %} sale-price text-red-500 font-bold{% else %} text-grey-600{% endif %}">
  27.             {{ unitPrice|number_format(2, ',', '')|replace({',00': ',-'}) }}
  28.         </span>
  29.     </div>
  30. {% endblock %}