custom/static-plugins/CytexTheme/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.         {# Price from removed per Cytex request #}
  8.         {% set isListPrice = price.listPrice.percentage > 0 %}
  9.         <p class="product-price{% if isListPrice and not displayFrom %} with-list-price {% endif %}">
  10.             {% if displayFrom %}
  11.                 <span class="product-price-displayfrom">
  12.                     {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  13.                 </span>
  14.             {% endif %}
  15.             {% if isListPrice and not displayFrom %}
  16.                 {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|trim|sw_sanitize %}
  17.                 {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|trim|sw_sanitize %}
  18.                 {% if beforeListPriceSnippetExists is same as("listing.beforeListPrice") %}
  19.                         {% set beforeListPriceSnippetExists = "" %}
  20.                     {% elseif afterListPriceSnippetExists is same as("listing.afterListPrice")  %}
  21.                         {% set afterListPriceSnippetExists = "" %}
  22.                 {% endif %}
  23.                 {% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
  24.                 {% set taxBase = price.calculatedTaxes|first %}
  25.                 <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through {% endif %}">
  26.                     {% if beforeListPriceSnippetExists %}{{ beforeListPriceSnippetExists}}{% endif %}
  27.                     <span class="list-price-price">{{ price.listPrice.price|currency }}</span>
  28.                     {% if afterListPriceSnippetExists %}{{ afterListPriceSnippetExists }}{% endif %}
  29.                 </span>
  30.             {% endif %}
  31.             {% set taxBase = price.calculatedTaxes|first %}
  32.             {% if context.taxState == "gross" %}
  33.                 {% set unitPriceExclVat = (taxBase.price - taxBase.tax) %}
  34.             {% else %}
  35.                 {% set unitPriceExclVat = price.unitPrice %}
  36.             {% endif %}
  37.             <span class="product-price-main">
  38.                 {{ unitPriceExclVat|currency }}
  39.             </span>
  40.         </p>
  41.     </div>
  42.     {% block component_product_box_price_vat %}
  43.         {% set taxBase = price.calculatedTaxes|first %}
  44.         {% if context.taxState == "gross" %}
  45.             {% set unitPriceInclVat = (taxBase.price) %}
  46.         {% else %}
  47.             {% set unitPriceInclVat = (taxBase.price + taxBase.tax) %}
  48.         {% endif %}
  49.         <div class="product-price-wrapper">
  50.             <p class="product-price-moms">
  51.                 ({{ "listing.moms-pre-text"|trans|sw_sanitize }} {{ unitPriceInclVat|currency }})
  52.             </p>
  53.         </div>
  54.     {% endblock %}
  55. {% endblock %}