app/Plugin/QuantityDiscountDx/Resource/template/shopping_parts.twig line 1

Open in your IDE?
  1. {% set isDiscount = is_quantity_discount(orderItem) %}
  2. {% if isDiscount %}
  3.     {% set discount = qd_discount_price_inc_tax(orderItem) %}
  4.     {% if qdIndex is defined %}
  5.         {% set suffix = '_'~qdIndex %}
  6.     {% else %}
  7.         {% set ProductClass = orderItem.ProductClass %}
  8.         {% set suffix = '_d_'~ProductClass.id %}
  9.     {% endif %}
  10.     <p id="quantity_discount{{ suffix }}" class="quantity_discount ec-color-accent">
  11.         {% set qd_mode_normal = is_qd_mode_normal() %}
  12.         {% if discount > 0 %}
  13.             {% if qd_mode_normal %}
  14.                 {{ 'quantity_discount_dx.front.quantity_discount_enabled'|trans({'%discount%': discount}) }}
  15.             {% else %}
  16.                 {{ 'quantity_discount_dx.front.quantity_discount_direct_enable'|trans }}
  17.             {% endif %}
  18.         {% endif %}
  19.     </p>
  20. {% endif %}