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

Open in your IDE?
  1. {% set listingPrice = variant.listingPrice %}
  2. {% set real = variant.price %}
  3. {% if variant.prices.count > 0 %}
  4.     {% set real = variant.prices.last.price.last %}
  5. {% endif %}
  6. <div class="col-3 product-price-info">
  7.     <div class="product-price-wrapper">
  8.         {% set price = real %}
  9.         {% set isListPrice = price.listPrice.percentage > 0 %}
  10.         {% if displayFrom or (displayParent and displayFromVariants) %}
  11.             {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  12.         {% endif %}
  13.         <span class="product-price{% if isListPrice and not displayFrom and not displayFromVariants %} with-list-price{% endif %}">
  14.             {% if main %}
  15.                 {% set price = page.product.calculatedPrice %}
  16.                 {% if page.product.calculatedPrices|length == 1 %}
  17.                     {% set price = page.product.calculatedPrices.first %}
  18.                 {% endif %}
  19.                 {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  20.             {% else %}
  21.                 {{ page.ldsVariantPricesOptions[group.id][option.id].productPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  22.             {% endif %}
  23.         </span>
  24.     </div>
  25. </div>