You are here

commerce-invoice-total-summary.html.twig in Commerce Invoice 8.2

Default invoice total summary template.

Available variables:

  • attributes: HTML attributes for the wrapper.
  • invoice_entity: The order entity.
  • totals: An array of order totals values with the following keys:
    • subtotal: The order subtotal price.
    • adjustments: The adjustments:
      • type: The adjustment type.
      • label: The adjustment label.
      • amount: The adjustment amount.
      • percentage: The decimal adjustment percentage, when available. For example, "0.2" for a 20% adjustment.
    • total: The order total price.

File

templates/commerce-invoice-total-summary.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default invoice total summary template.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the wrapper.
  8. * - invoice_entity: The order entity.
  9. * - totals: An array of order totals values with the following keys:
  10. * - subtotal: The order subtotal price.
  11. * - adjustments: The adjustments:
  12. * - type: The adjustment type.
  13. * - label: The adjustment label.
  14. * - amount: The adjustment amount.
  15. * - percentage: The decimal adjustment percentage, when available. For example, "0.2" for a 20% adjustment.
  16. * - total: The order total price.
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. {{ attach_library('commerce_order/total_summary') }}
  22. <div{{ attributes }}>
  23. <div class="order-total-line order-total-line__subtotal">
  24. <span class="order-total-line-label">{{ 'Subtotal'|t }} </span><span class="order-total-line-value">{{ totals.subtotal|commerce_price_format }}</span>
  25. </div>
  26. {% for adjustment in totals.adjustments %}
  27. <div class="order-total-line order-total-line__adjustment order-total-line__adjustment--{{ adjustment.type|clean_class }}">
  28. <span class="order-total-line-label">{{ adjustment.label }} </span><span class="order-total-line-value">{{ adjustment.amount|commerce_price_format }}</span>
  29. </div>
  30. {% endfor %}
  31. <div class="order-total-line order-total-line__total">
  32. <span class="order-total-line-label">{{ 'Total'|t }} </span><span class="order-total-line-value">{{ totals.total|commerce_price_format }}</span>
  33. </div>
  34. </div>