custom/plugins/AcrisPromotionCS/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.     {% set price = real %}
  4.     {% set isListPrice = price.listPrice.percentage > 0 %}
  5.     {% set isCheapestListPrice = cheapest.listPrice.percentage > 0 %}
  6.     {% set isRegulationPrice = price.regulationPrice != null %}
  7.     {% if isListPrice and displayFrom %}
  8.         <div class="product-price-wrapper">
  9.             {% set price = real %}
  10.             <div class="product-cheapest-price">
  11.                 {% if cheapest.unitPrice != real.unitPrice %}
  12.                     <div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}<span class="product-cheapest-price-price"> {{ cheapest.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}</span></div>
  13.                 {% endif %}
  14.             </div>
  15.             {% if displayFrom %}
  16.                 {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  17.             {% endif %}
  18.             {% set isListPrice = price.listPrice.percentage > 0 %}
  19.             <span class="product-price{% if isListPrice %} with-list-price{% endif %}">
  20.                 {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  21.                 {% if isListPrice %}
  22.                     {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
  23.                     {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
  24.                     {% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
  25.                     <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
  26.                             {% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %}
  27.                             <span class="list-price-price">{{ price.listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
  28.                             {% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
  29.                             <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
  30.                         </span>
  31.                 {% endif %}
  32.             </span>
  33.         </div>
  34.     {% else %}
  35.         {% if isListPrice and not displayFrom %}
  36.             {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
  37.             {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
  38.             {% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
  39.             <div class="product-price-wrapper">
  40.                 <div class="product-cheapest-price {% if isListPrice and isRegulationPrice and not displayFrom %} with-list-price{% endif %}{% if isRegulationPrice and not displayFrom %} with-regulation-price{% endif %}{% if displayFrom and isRegulationPrice %} with-from-price{% endif %}">
  41.                     {% if cheapest.unitPrice != real.unitPrice %}
  42.                         <div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}
  43.                             <span class="product-cheapest-price-price"> {% if isCheapestListPrice %}<span class="acris-promotion-discount-price">{{ cheapest.unitPrice|currency }}</span>{% else %}{{ cheapest.unitPrice|currency }}{% endif %}{{ "general.star"|trans|sw_sanitize }}
  44.                                 {% if isCheapestListPrice %}
  45.                                     <span class="product-price{% if isCheapestListPrice and not displayFrom %} with-list-price{% endif %}">
  46.                                     <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
  47.                                         {% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %}
  48.                                         <span class="list-price-price">{{ cheapest.listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
  49.                                         {% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
  50.                                         <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': cheapest.listPrice.percentage })|sw_sanitize }}</span>
  51.                                     </span>
  52.                                 </span>
  53.                                 {% endif %}
  54.                             </span>
  55.                         </div>
  56.                     {% endif %}
  57.                 </div>
  58.                 {% if displayFrom or displayParent %}
  59.                     {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  60.                 {% endif %}
  61.                 <span class="product-price{% if isListPrice and not displayFrom %} with-list-price{% endif %}">
  62.                     {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  63.                     <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
  64.                         {% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %}
  65.                         <span class="list-price-price">{{ price.listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
  66.                         {% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
  67.                         <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
  68.                     </span>
  69.                 </span>
  70.                 {% if isRegulationPrice %}
  71.                     <span class="product-price with-regulation-price">
  72.                         {% if isListPrice %}<br/>{% endif %}<span class="regulation-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}{{ "general.star"|trans|sw_sanitize }}</span>
  73.                     </span>
  74.                 {% endif %}
  75.             </div>
  76.         {% else %}
  77.             {{ parent() }}
  78.         {% endif %}
  79.     {% endif %}
  80. {% endblock %}