custom/plugins/sw-asus/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.     {% set currencySymbol = page.header.activeCurrency.symbol %}
  8.     {% set listPrice = product.calculatedCheapestPrice.listPrice %}
  9.     {# {% set listPrice = product.priceRange or product.calculatedPrices.count > 0 ? null : product.calculatedPrice.listPrice %} #}
  10.     <div class="product-price-info">
  11.         {% block component_product_box_price_unit %}
  12.             {# remove #}
  13.         {% endblock %}
  14.         {% block component_product_box_price %}
  15.             <div class="product-price">
  16.                 {{ product.calculatedCheapestPrice.unitPrice|currency }}
  17.                 <span class="product-detail-list-price-wrapper">
  18.                 {% if listPrice.percentage >= 10 %}
  19.                     {{"listing.beforeListPrice"|trans|trim}}
  20.                     <span class="line-through" {% if not ("listing.beforeListPrice"|trans|length > 0 or "listing.afterListPrice"|trans|length > 0) %}class="list-price-price"{% endif %}>
  21.                         {{ listPrice.price|number_format(2, ',', '.') }} {{ currencySymbol }}
  22.                     </span>
  23.                     *
  24.                     {{"listing.afterListPrice"|trans|trim}}
  25.                     <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': listPrice.percentage|round })|sw_sanitize }}</span>
  26.                  {% endif %}
  27.             </div>
  28.         {% endblock %}
  29.         {# OLD, delete if everything is okay with the new one on top #}
  30.         {# {% block component_product_box_price %}
  31.             <div class="product-price">
  32.                 {% if (product.priceRange and product.isGrouped) or product.calculatedPrices.count > 1 %}
  33.                     {{ fromPrice.unitPrice|currency }}
  34.                     -
  35.                     {{ listingPrice.to.unitPrice }} {{ currencySymbol }}
  36.                 {% elseif product.calculatedPrices|length == 1 %}
  37.                     {{ product.calculatedPrices.first.unitPrice|currency }}
  38.                 {% else %}
  39.                     {{ product.calculatedPrice.unitPrice|currency }}
  40.                     {% if listPrice.percentage > 0 %}
  41.                         <span class="list-price{% if "listing.beforeListPrice"|trans|length > 0 or "listing.afterListPrice"|trans|length > 0  %} list-price-no-line-through{% endif %}">
  42.                             {{"listing.beforeListPrice"|trans|trim}} <span class="line-through">{{ listPrice.price|currency }}</span> {{ "productBox.priceSave"|trans|sw_sanitize }} {{ listPrice.discount * (-1)|currency }} {{"listing.afterListPrice"|trans|trim}}
  43.                         </span> #}
  44.                          {#ToDo
  45.                         <div class="info end-date">Ends in 20:45:06<span>{% sw_icon 'bell' style { 'pack':'default' } %}</span></div>
  46.                         <div class="info">Members Only / limit of 1 per member</div>#}
  47.                     {# {% endif %}
  48.                 {% endif %}
  49.             </div>
  50.         {% endblock %} #}
  51.     </div>
  52. {% endblock %}