custom/plugins/econdCrossSelll/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.     {# @deprecated tag:v6.5.0 - purchaseUnit will be removed, use product.purchaseUnit if needed #}
  4.     {% set purchaseUnit = product.purchaseUnit %}
  5.     {# @deprecated tag:v6.5.0 - listingPrice will be removed without replacement, since it was removed from the product struct #}
  6.     {% set listingPrice = product.calculatedListingPrice %}
  7.     {# @deprecated tag:v6.5.0 - fromPrice will be removed without replacement #}
  8.     {% set fromPrice = listingPrice.from %}
  9.     {% set cheapest = product.calculatedCheapestPrice %}
  10.     {% set real = product.calculatedPrice %}
  11.     {% if product.calculatedPrices.count > 0 %}
  12.         {% set real = product.calculatedPrices.last %}
  13.     {% endif %}
  14.     {% set referencePrice = real.referencePrice %}
  15.     {% set displayFrom = product.calculatedPrices.count > 1 %}
  16.     {% set displayParent = product.variantListingConfig.displayParent and product.parentId === null %}
  17.     {% if displayParent %}
  18.         {% set displayFromVariants = displayParent and real.unitPrice !== cheapest.unitPrice %}
  19.         {% set real = cheapest %}
  20.     {% endif %}
  21.     <div class="product-price-info">
  22.         {% block component_product_box_price_unit %}
  23.             {% if referencePrice.unitName %}
  24.                 <p class="product-price-unit">
  25.                     {# Price is based on the purchase unit #}
  26.                     {% block component_product_box_price_purchase_unit %}
  27.                         {% if referencePrice and referencePrice.unitName %}
  28.                             <span class="product-unit-label">
  29.                             {{ "listing.boxUnitLabel"|trans|sw_sanitize }}
  30.                         </span>
  31.                             <span class="price-unit-content">
  32.                             {{ referencePrice.purchaseUnit }} {{ referencePrice.unitName }}
  33.                         </span>
  34.                         {% endif %}
  35.                     {% endblock %}
  36.                     {# Item price is based on a reference unit #}
  37.                     {% block component_product_box_price_reference_unit %}
  38.                         {% if referencePrice is not null %}
  39.                             <span class="price-unit-reference">
  40.                             ({{ referencePrice.price|currency }}{{ "general.star"|trans|sw_sanitize }} / {{ referencePrice.referenceUnit }} {{ referencePrice.unitName }})
  41.                         </span>
  42.                         {% endif %}
  43.                     {% endblock %}
  44.                 </p>
  45.             {% endif %}
  46.         {% endblock %}
  47.         {% block component_product_box_price %}
  48.             <div class="product-price-wrapper">
  49.                 {% set price = real %}
  50.                 {% set isListPrice = price.listPrice.percentage > 0 %}
  51.                 {% set isRegulationPrice = price.regulationPrice != null %}
  52.                 {% if cheapest.unitPrice != real.unitPrice %}
  53.                     <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 %}">
  54.                         <div>{{ "listing.cheapestPriceLabel"|trans|sw_sanitize }}<span class="product-cheapest-price-price"> {{ cheapest.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}</span></div>
  55.                     </div>
  56.                 {% endif %}
  57.                 {% if displayFrom or (displayParent and displayFromVariants) %}
  58.                     {{ "listing.listingTextFrom"|trans|sw_sanitize }}
  59.                 {% endif %}
  60.                 <span class="product-price{% if isListPrice and not displayFrom and not displayFromVariants %} with-list-price{% endif %}">
  61.                     {{ price.unitPrice|currency }}{{ "general.star"|trans|sw_sanitize }}
  62.                     {% if isListPrice and not displayFrom and not displayFromVariants %}
  63.                         {% set afterListPriceSnippetExists = "listing.afterListPrice"|trans|length > 0 %}
  64.                         {% set beforeListPriceSnippetExists = "listing.beforeListPrice"|trans|length > 0 %}
  65.                         {% set hideStrikeTrough = beforeListPriceSnippetExists or afterListPriceSnippetExists %}
  66.                         <span class="list-price{% if hideStrikeTrough %} list-price-no-line-through{% endif %}">
  67.                             {% if beforeListPriceSnippetExists %}{{ "listing.beforeListPrice"|trans|trim|sw_sanitize }}{% endif %}
  68.                             <span class="list-price-price">{{ price.listPrice.price|currency }}{{ "general.star"|trans|sw_sanitize }}</span>
  69.                             {% if afterListPriceSnippetExists %}{{ "listing.afterListPrice"|trans|trim|sw_sanitize }}{% endif %}
  70.                             <span class="list-price-percentage">{{ "detail.listPricePercentage"|trans({'%price%': price.listPrice.percentage })|sw_sanitize }}</span>
  71.                         </span>
  72.                     {% endif %}
  73.                 </span>
  74.                 {% if isRegulationPrice %}
  75.                     <span class="product-price with-regulation-price">
  76.                         {% if isListPrice %}<br/>{% endif %}<span class="regulation-price">{{ "general.listPricePreviously"|trans({'%price%': price.regulationPrice.price|currency }) }}{{ "general.star"|trans|sw_sanitize }}</span>
  77.                     </span>
  78.                 {% endif %}
  79.             </div>
  80.         {% endblock %}
  81.     </div>
  82. {% endblock %}