You are here

commerce-order-receipt--purchase-order-gateway.html.twig in Commerce Purchase Order 8

Template override for the order receipt.

Adds payment instructions.

Available variables:

  • order_entity: The order entity.
  • billing_information: The rendered billing information.
  • shipping_information: The rendered shipping information.
  • payment_method: The rendered payment method.
  • payment_instructions: The built payment instructions.
  • 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

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