custom/plugins/ChiliCustom/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_info %}
  3.     {% set purchaseUnit = product.purchaseUnit %}
  4.     {% set listingPrice = product.calculatedListingPrice %}
  5.     {% set fromPrice = listingPrice.from %}
  6.     {% set referncePrice = product.calculatedPrice.referencePrice %}
  7.     <div class="product-price-info">
  8.         {% block component_product_box_price_unit %}
  9.         {% endblock %}
  10.         {% block component_product_box_price %}
  11.             {% set listPrice = product.priceRange or product.calculatedPrices.count > 0 ? null : product.calculatedPrice.listPrice %}
  12.             {% set advancedPricesFlag = product.calculatedPrices.count > 0 %}
  13.             {% if product.calculatedPrices.count < 2 %}
  14.                 {% set advancedPricesFlag = false %}
  15.             {% endif %}
  16.             {% if listPrice is null and product.calculatedPrices|length == 1 %}
  17.                 {% set listPrice = product.calculatedPrices|first.listPrice %}
  18.             {% endif %}
  19.             {% if advancedPricesFlag and listPrice is null %}
  20.                 {% block component_product_box_block_list_price_wrapper %}
  21.                     {% set cheapestPrice = product.calculatedPrices|first %}
  22.                     {% for calcPrice in product.calculatedPrices %}
  23.                         {% if cheapestPrice.unitPrice > calcPrice.unitPrice %}
  24.                             {% set cheapestPrice = calcPrice %}
  25.                         {% endif %}
  26.                     {% endfor %}
  27.                     <span class="product-price product-advanced-list-price-wrapper">
  28.                          {{ cheapestPrice.unitPrice|currency }}
  29.                         <p class="mwst-box">{{ "inkl. Mwst" }}</p>
  30.                     </span>
  31.                 {% endblock %}
  32.             {% else %}
  33.                 <p class="product-price{% if listPrice.percentage > 0 %} with-list-price{% endif %}">
  34.                     {% if (product.priceRange and product.isGrouped) or product.calculatedPrices.count > 1 %}
  35.                         {{ fromPrice.unitPrice|currency }}
  36.                         -
  37.                         {{ listingPrice.to.unitPrice|currency}}
  38.                         <p class="mwst-box">{{ "inkl. Mwst" }}</p>
  39.                     {% elseif product.calculatedPrices|length == 1 %}
  40.                         {{ product.calculatedPrices.first.unitPrice|currency }}
  41.                         <p class="mwst-box">{{ "inkl. Mwst" }}</p>
  42.                         {% if listPrice.percentage > 0 %}
  43.                             <span class="list-price{% if "listing.beforeListPrice"|trans|length > 0 or "listing.afterListPrice"|trans|length > 0  %} list-price-no-line-through{% endif %}">
  44.                                 {{ listPrice.price|currency }}
  45.                                 <p class="mwst-box">{{ "inkl. Mwst" }}</p>
  46.                             </span>
  47.                         {% endif %}
  48.                     {% else %}
  49.                         {{ product.calculatedPrice.unitPrice|currency}}
  50.                         <p class="mwst-box">{{ "inkl. Mwst" }}</p>
  51.                         {% if listPrice.percentage > 0 %}
  52.                             <span class="list-price{% if "listing.beforeListPrice"|trans|length > 0 or "listing.afterListPrice"|trans|length > 0  %} list-price-no-line-through{% endif %}">
  53.                                 </span>
  54.                         {% endif %}
  55.                     {% endif %}
  56.                 </p>
  57.             {% endif %}
  58.         {% endblock %}
  59.     </div>
  60. {% endblock %}