custom/plugins/FourtwosixThemeExtension/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_reference_unit %}{% endblock %}
  3. {% block component_product_box_price %}
  4.     {# @fourtwosix-edit: FV: imported custom fields value #}
  5.     {% set showPrice = product.translated.customFields['akeneo_statusinshoppreiszeigen']  ?? true %}
  6.     {# @fourtwosix-edit: FV: added condition  #}
  7.     {% if showPrice %}
  8.     <div class="product-price-wrapper">
  9.         {% set price = real %}
  10.         {% set isListPrice = price.listPrice.percentage > 0 %}
  11.         {% set isRegulationPrice = price.regulationPrice != null %}
  12.         <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 %}">
  13.             {% if cheapest.unitPrice != real.unitPrice %}
  14.                 <div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}
  15.                     <span class="product-cheapest-price-price"> 
  16.                         {{ cheapest.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  17.                     </span>
  18.                 </div>
  19.             {% endif %}
  20.         </div>
  21.         {% if displayFrom or (displayParent and displayFromVariants) %}
  22.             {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  23.         {% endif %}
  24.         <span class="product-price{% if isListPrice and not displayFrom and not displayFromVariants %} with-list-price{% endif %}">
  25.             {% set purchaseUnit = product.calculatedPrice.referencePrice.purchaseUnit ? product.calculatedPrice.referencePrice.purchaseUnit : product.purchaseUnit %}
  26.             {% set listPrice = product.calculatedPrice.listPrice %}
  27.             {% set customListPrice = listPrice.price / purchaseUnit %}
  28.             
  29.             {% if referencePrice %}
  30.                 {{ referencePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}/{{ referencePrice.unitName }}
  31.             {% else %}
  32.                 {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}/{{ "fts.unit.box"|trans}}
  33.             {% endif %}
  34.             {% if isListPrice and not displayFrom and not displayFromVariants %}
  35.                 {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
  36.                 {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
  37.                 {% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
  38.                 <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
  39.                     {% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %}
  40.                     {% if customListPrice %}
  41.                         <span class="list-price-price">{{ customListPrice|currency }}{{ "general.star"|trans|sw_sanitize }}/{{ referencePrice.unitName }}</span>
  42.                     {% else %}
  43.                         <span class="list-price-price">{{ price.listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
  44.                     {% endif %}
  45.                     {% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
  46.                     <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
  47.                 </span>
  48.             {% endif %}
  49.         </span>
  50.         {% if isRegulationPrice %}
  51.             <span class="product-price with-regulation-price">
  52.                 {% if isListPrice %}<br/>{% endif %}<span class="regulation-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}{{ "general.star"|trans|sw_sanitize }}</span>
  53.             </span>
  54.         {% endif %}
  55.     </div>
  56.     {% endif %}
  57. {% endblock %}