custom/plugins/BEYCODENT/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.     {% if context.salesChannel.name != 'BEYCODENT' %}
  4.         {{ parent() }}
  5.     {% else %}
  6.     {% endif %}
  7. {% endblock %}
  8. {% block component_product_box_price_unit %}
  9.     <p class="product-price-unit">
  10.         {# Price is based on the purchase unit #}
  11.         {% block component_product_box_price_purchase_unit %}
  12.             {% if referencePrice and referencePrice.unitName %}
  13.                 <span class="product-unit-label">
  14.                     {{ "listing.boxUnitLabel"|trans|sw_sanitize }}
  15.                 </span>
  16.                 <span class="price-unit-content">
  17.                     {{ referencePrice.purchaseUnit }} {{ referencePrice.unitName }}
  18.                 </span>
  19.             {% endif %}
  20.         {% endblock %}
  21.         {# Item price is based on a reference unit #}
  22.         {% block component_product_box_price_reference_unit %}
  23.             {% if referencePrice is not null %}
  24.                 <span class="price-unit-reference">
  25.                     ({{ referencePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }} / {{ referencePrice.referenceUnit }} {{ referencePrice.unitName }})
  26.                 </span>
  27.             {% endif %}
  28.         {% endblock %}
  29.     </p>
  30. {% endblock %}
  31. {% block component_product_box_price %}
  32.      <div class="product-price-wrapper">
  33.         {% set price = real %}
  34.         {% set isListPrice = price.listPrice.percentage > 0 %}
  35.         {% set isRegulationPrice = price.regulationPrice != null %}
  36.         {% if component_product_box_price != null %}
  37.             {% if cheapest.regulationPrice  || cheapest.listPrice %}
  38.                 <div class="product-cheapest-price{% if isListPrice and price.regulationPrice.price and not displayFrom %} with-list-price{% endif %}{% if isRegulationPrice and displayFrom %} with-regulation-price{% endif %}">
  39.                 {% if cheapest.unitPrice != real.unitPrice %}
  40.                     <div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}<span class="product-cheapest-price-price"> {{ cheapest.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}</span></div>
  41.                 {% endif %}
  42.                 </div>
  43.             </div>
  44.             {% endif %}
  45.         {% endif %}
  46.         
  47.         {% if displayFrom %}
  48.             {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  49.         {% endif %}
  50.         <span class="product-price{% if isListPrice and not displayFrom %} with-list-price{% endif %}">
  51.             {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  52.             {% if isListPrice and not displayFrom %}
  53.                 {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
  54.                 {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
  55.                 {% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
  56.                 <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
  57.                     {% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %}
  58.                     <span class="list-price-price">{{ price.listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
  59.                     {% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
  60.                     <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
  61.                 </span>
  62.             {% endif %}
  63.         </span>
  64.         {% if isRegulationPrice %}
  65.             <span class="product-price with-regulation-price">
  66.                 {% if isListPrice %}<br/>{% endif %}<span class="regulation-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}{{ "general.star"|trans|sw_sanitize }}</span>
  67.             </span>
  68.         {% endif %}
  69.     </div>
  70. {% endblock %}