custom/plugins/theme/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_unit %}
  3. {% endblock %}
  4. {% block component_product_box_price %}
  5.     <div class="product-price-wrapper">
  6.         {% set price = real %}
  7.         {% set isListPrice = price.listPrice.percentage > 0 %}
  8.         {% set isRegulationPrice = price.regulationPrice != null %}
  9.         {% if displayFrom %}
  10.             {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  11.         {% endif %}
  12.         <span class="product-price{% if isListPrice and not displayFrom %} with-list-price{% endif %}">
  13.             {{ price.unitPrice|currency }}
  14.             {% if isListPrice and not displayFrom %}
  15.                 {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
  16.                 {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
  17.                 {% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
  18.                 <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
  19.                     {% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %}
  20.                     <span class="list-price-price">{{ price.listPrice.price|currency }}</span>
  21.                 </span>
  22.             {% endif %}
  23.         </span>
  24.         {% if isRegulationPrice %}
  25.             <span class="product-price with-regulation-price">
  26.                 {% if isListPrice %}<br/>{% endif %}<span class="regulation-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}</span>
  27.             </span>
  28.         {% endif %}
  29.         
  30.         <p class="product-price-unit">
  31.             {# Price is based on the purchase unit #}
  32.             {% block component_product_box_price_purchase_unit %}
  33.             {% endblock %}
  34.             {# Item price is based on a reference unit #}
  35.             {% block component_product_box_price_reference_unit %}
  36.                 {% if referencePrice is not null %}
  37.                     <span class="price-unit-reference">
  38.                         {{ referencePrice.price|currency }} / {{ referencePrice.referenceUnit }} {{ referencePrice.unitName }}
  39.                     </span>
  40.                 {% endif %}
  41.             {% endblock %}
  42.         </p>
  43.         
  44.     </div>
  45. {% endblock %}