You are here

commerce-order-receipt.html.twig in Commerce Core 8.2

Template for the order receipt.

Available variables:

  • order_entity: The order entity.
  • billing_information: The billing information.
  • shipping_information: The shipping information.
  • payment_method: The payment method.
  • totals: An array of order totals 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.

File

modules/order/templates/commerce-order-receipt.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template for the order receipt.
  5. *
  6. * Available variables:
  7. * - order_entity: The order entity.
  8. * - billing_information: The billing information.
  9. * - shipping_information: The shipping information.
  10. * - payment_method: The payment method.
  11. * - totals: An array of order totals values with the following keys:
  12. * - subtotal: The order subtotal price.
  13. * - adjustments: An array of adjustment totals:
  14. * - type: The adjustment type.
  15. * - label: The adjustment label.
  16. * - total: The adjustment total price.
  17. * - weight: The adjustment weight, taken from the adjustment type.
  18. * - total: The order total price.
  19. *
  20. * @ingroup themeable
  21. */
  22. #}
  23. <table style="margin: 15px auto 0 auto; max-width: 768px; font-family: arial,sans-serif">
  24. <tbody>
  25. <tr>
  26. <td>
  27. <table style="margin-left: auto; margin-right: auto; max-width: 768px; text-align: center;">
  28. <tbody>
  29. <tr>
  30. <td>
  31. <a href="{{ url('<front>') }}" style="color: #0e69be; text-decoration: none; font-weight: bold; margin-top: 15px;">{{ order_entity.getStore.label }}</a>
  32. </td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. <table style="text-align: center; min-width: 450px; margin: 5px auto 0 auto; border: 1px solid #cccccc; border-radius: 5px; padding: 40px 30px 30px 30px;">
  37. <tbody>
  38. <tr>
  39. <td style="font-size: 30px; padding-bottom: 30px">{{ 'Order Confirmation'|t }}</td>
  40. </tr>
  41. <tr>
  42. <td style="font-weight: bold; padding-top:15px; padding-bottom: 15px; text-align: left; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc">
  43. {{ 'Order #@number details:'|t({'@number': order_entity.getOrderNumber}) }}
  44. </td>
  45. </tr>
  46. <tr>
  47. <td>
  48. {% block order_items %}
  49. <table style="padding-top: 15px; padding-bottom:15px; width: 100%">
  50. <tbody style="text-align: left;">
  51. {% for order_item in order_entity.getItems %}
  52. <tr>
  53. <td>
  54. {{ order_item.getQuantity|number_format }} x
  55. </td>
  56. <td>
  57. <span>{{ order_item.label }}</span>
  58. <span style="float: right;">{{ order_item.getTotalPrice|commerce_price_format }}</span>
  59. </td>
  60. </tr>
  61. {% endfor %}
  62. </tbody>
  63. </table>
  64. {% endblock %}
  65. </td>
  66. </tr>
  67. <tr>
  68. <td>
  69. {% if (billing_information or shipping_information) %}
  70. <table style="width: 100%; padding-top:15px; padding-bottom: 15px; text-align: left; border-top: 1px solid #cccccc; border-bottom: 1px solid #cccccc">
  71. <tbody>
  72. <tr>
  73. {% if shipping_information %}
  74. <td style="padding-top: 5px; font-weight: bold;">{{ 'Shipping Information'|t }}</td>
  75. {% endif %}
  76. {% if billing_information %}
  77. <td style="padding-top: 5px; font-weight: bold;">{{ 'Billing Information'|t }}</td>
  78. {% endif %}
  79. </tr>
  80. <tr>
  81. {% if shipping_information %}
  82. <td>
  83. {% block shipping_information %}
  84. {{ shipping_information }}
  85. {% endblock %}
  86. </td>
  87. {% endif %}
  88. {% if billing_information %}
  89. <td>
  90. {% block billing_information %}
  91. {{ billing_information }}
  92. {% endblock %}
  93. </td>
  94. {% endif %}
  95. </tr>
  96. {% if payment_method %}
  97. <tr>
  98. <td style="font-weight: bold; margin-top: 10px;">{{ 'Payment Method'|t }}</td>
  99. </tr>
  100. <tr>
  101. <td>
  102. {% block payment_method %}
  103. {{ payment_method }}
  104. {% endblock %}
  105. </td>
  106. </tr>
  107. {% endif %}
  108. </tbody>
  109. </table>
  110. {% endif %}
  111. </td>
  112. </tr>
  113. <tr>
  114. <td>
  115. <p style="margin-bottom: 0;">
  116. {{ 'Subtotal: @subtotal'|t({'@subtotal': totals.subtotal|commerce_price_format}) }}
  117. </p>
  118. </td>
  119. </tr>
  120. {% for adjustment in totals.adjustments %}
  121. <tr>
  122. <td>
  123. <p style="margin-bottom: 0;">
  124. {{ adjustment.label }}: {{ adjustment.total|commerce_price_format }}
  125. </p>
  126. </td>
  127. </tr>
  128. {% endfor %}
  129. <tr>
  130. <td>
  131. <p style="font-size: 24px; padding-top: 15px; padding-bottom: 5px;">
  132. {{ 'Order Total: @total'|t({'@total': order_entity.getTotalPrice|commerce_price_format}) }}
  133. </p>
  134. </td>
  135. </tr>
  136. <tr>
  137. <td>
  138. {% block additional_information %}
  139. {{ 'Thank you for your order!'|t }}
  140. {% endblock %}
  141. </td>
  142. </tr>
  143. </tbody>
  144. </table>
  145. </td>
  146. </tr>
  147. </tbody>
  148. </table>