custom/plugins/fourtwosixAddPurchaseUnit/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 %}
  3.     <div class="product-price-wrapper">
  4.         {% set price = real %}
  5.         {% set isListPrice = price.listPrice.percentage > 0 %}
  6.         {% set isRegulationPrice = price.regulationPrice != null %}
  7.         <div class="product-cheapest-price{% if isListPrice and isRegulationPrice and not displayFrom and not displayFromVariants %} with-list-price{% endif %}{% if isRegulationPrice and not displayFrom and displayFromVariants %} with-regulation-price{% endif %}{% if displayFrom and isRegulationPrice %} with-from-price{% endif %}">
  8.             {% if cheapest.unitPrice != real.unitPrice %}
  9.                 <div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}<span class="product-cheapest-price-price">
  10.                         {{ cheapest.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
  11.                 </div>
  12.             {% endif %}
  13.         </div>
  14.         {% if displayFrom or (displayParent and displayFromVariants) %}
  15.             {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  16.         {% endif %}
  17.         <span class="product-price{% if isListPrice and not displayFrom and not displayFromVariants %} with-list-price{% endif %}">
  18.             {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}/{{ "fts.unit.box"|trans}}
  19.             
  20.             {% if isListPrice and not displayFrom and not displayFromVariants %}
  21.                 {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
  22.                 {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
  23.                 {% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
  24.                 <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
  25.                     {% if beforeListPriceSnippetExists %}
  26.                         {{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}
  27.                     {% endif %}
  28.                     <span class="list-price-price">{{ price.listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
  29.                     {% if afterListPriceSnippetExists %}
  30.                         {{ "listing.afterListPrice"|trans|trim|sw_sanitize }}
  31.                     {% endif %}
  32.                     <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
  33.                 </span>
  34.             {% endif %}
  35.         </span>
  36.         {% if isRegulationPrice %}
  37.             <span class="product-price with-regulation-price">
  38.                 {% if isListPrice %}<br/>
  39.                 {% endif %}
  40.                 <span class="regulation-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}{{ "general.star"|trans|sw_sanitize }}</span>
  41.             </span>
  42.         {% endif %}
  43.     </div>
  44. {% endblock %}