custom/plugins/WebLabels/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_reference_unit %}
  3. {% endblock %}
  4. {% block component_product_box_price_purchase_unit %}
  5. {% endblock %}
  6. {% block component_product_box_price %}
  7.     <p class="price-unit-content">
  8.            {{ "listing.boxUnitLabel"|trans|sw_sanitize }} {{ purchaseUnit }} {{ product.unit.translated.shortCode }}{% if product.translated.customFields.custom_entspricht_ %}<span>&nbsp;({{ product.translated.customFields.custom_entspricht_ }})</span>{% endif %}
  9.         </p>
  10.     <div class="product-price-wrapper">
  11.                 {% set price = real %}
  12.                 {% set purchaseUnit = product.purchaseUnit %}
  13.                 {% set listingPrice = product.calculatedListingPrice %}
  14.                 {% set fromPrice = listingPrice.from %}
  15.                 {% set referncePrice = product.calculatedPrice.referencePrice %}
  16.                 <div class="product-cheapest-price">
  17.                     {% if cheapest.unitPrice != real.unitPrice %}
  18.                         <div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}<span class="product-cheapest-price-price"> {{ cheapest.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}</span></div>
  19.                     {% endif %}
  20.                 </div>
  21.                 {% if displayFrom %}
  22.                     {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  23.                 {% endif %}
  24.                 {% set isListPrice = price.listPrice.percentage > 0 %}
  25.                 <span class="product-price{% if isListPrice and not displayFrom %} with-list-price{% endif %}">
  26.                     {{ price.unitPrice|currency }}
  27.                     {% if isListPrice and not displayFrom %}
  28.                         {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
  29.                         {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
  30.                         {% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
  31.                         <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
  32.                             {% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %}
  33.                             <span class="list-price-price">{{ price.listPrice.price|currency }}</span>
  34.                             {% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
  35.                             <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
  36.                         </span>
  37.                     {% endif %}
  38.                 </span>
  39.                  {% if referncePrice is not null %}
  40.         <span class="price-unit-reference">
  41.             {% if (product.priceRange and product.isGrouped) or product.calculatedPrices.count > 1 %}
  42.                 ({{ "listing.listingTextFrom"|trans|sw_sanitize }} {{ fromPrice.referencePrice.price|currency }} / {{ fromPrice.referencePrice.referenceUnit }}&nbsp; {{ product.unit.translated.shortCode }})
  43.             {% else %}
  44.                 ({{ referncePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }} / {{ referncePrice.referenceUnit }} {{ product.unit.translated.shortCode }})
  45.             {% endif %}
  46.         </span>
  47.         
  48.             {% endif %}
  49.             {% if (product.priceRange and product.isGrouped) or product.calculatedPrices.count > 1 %}
  50.             <span class="price-unit-reference">{{ "general.star"|trans|sw_sanitize }}</span>
  51.             {% else %}
  52.                <span class="product-price">{{ "general.star"|trans|sw_sanitize }}</span>
  53.             {% endif %}
  54.             </div>
  55.     
  56.     
  57. {% endblock %}
  58. {% block component_product_box_price_unit %}
  59. {% endblock %}