You are here

commerce-checkout-order-summary.html.twig in Commerce Core 8.2

Default theme implementation for the checkout order summary.

The rendered order totals come from commerce-order-total-summary.html.twig. See commerce-order-receipt.html.twig for examples of manual total theming.

Available variables:

  • order_entity: The order entity.
  • checkout_step: The current checkout step.
  • totals: An array of order total values with the following keys:
    • subtotal: The order subtotal price.
    • adjustments: An array of adjustment totals:
      • type: The adjustment type.
      • label: The adjustment label.
      • total: The adjustment total price.
      • weight: The adjustment weight, taken from the adjustment type.
    • total: The order total price.
  • rendered_totals: The rendered order totals.

File

modules/checkout/templates/commerce-checkout-order-summary.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the checkout order summary.
  5. *
  6. * The rendered order totals come from commerce-order-total-summary.html.twig.
  7. * See commerce-order-receipt.html.twig for examples of manual total theming.
  8. *
  9. * Available variables:
  10. * - order_entity: The order entity.
  11. * - checkout_step: The current checkout step.
  12. * - totals: An array of order total values with the following keys:
  13. * - subtotal: The order subtotal price.
  14. * - adjustments: An array of adjustment totals:
  15. * - type: The adjustment type.
  16. * - label: The adjustment label.
  17. * - total: The adjustment total price.
  18. * - weight: The adjustment weight, taken from the adjustment type.
  19. * - total: The order total price.
  20. * - rendered_totals: The rendered order totals.
  21. */
  22. #}
  23. <div{{ attributes.addClass('checkout-order-summary') }}>
  24. {% block order_items %}
  25. <table>
  26. <tbody>
  27. {% for order_item in order_entity.getItems %}
  28. <tr>
  29. <td>{{ order_item.getQuantity|number_format }}&nbsp;x</td>
  30. {% if order_item.hasPurchasedEntity %}
  31. <td>{{ order_item.getPurchasedEntity|commerce_entity_render('summary') }}</td>
  32. {% else %}
  33. <td>{{- order_item.label -}}</td>
  34. {% endif %}
  35. <td>{{- order_item.getTotalPrice|commerce_price_format -}}</td>
  36. </tr>
  37. {% endfor %}
  38. </tbody>
  39. </table>
  40. {% endblock %}
  41. {% block totals %}
  42. {{ rendered_totals }}
  43. {% endblock %}
  44. </div>