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