You are here

uc-order-invoice.html.twig in Ubercart 8.4

{#
 * This file is the default customer invoice template for Ubercart.
 *
 * Available variables:
 * - products: An array of product objects in the order, with the following
 *   members:
 *   - title: The product title.
 *   - model: The product SKU.
 *   - qty: The quantity ordered.
 *   - total_price: The formatted total price for the quantity ordered.
 *   - individual_price: If quantity is more than 1, the formatted product
 *     price of a single item.
 *   - details: Any extra details about the product, such as attributes.
 * - line_items: An array of line item arrays attached to the order, each with
 *   the following keys:
 *   - type: The type of line item (subtotal, shipping, etc.).
 *   - title: The line item display title.
 *   - formatted_amount: The formatted amount of the line item.
 * - shippable: TRUE if the order is shippable.
 *
 * Tokens: All site, store and order tokens are also available as
 * variables, such as site_logo, store_name and order_first_name.
 *
 * Display options:
 * - op: 'view', 'print', 'checkout-mail' or 'admin-mail', depending on
 *   which variant of the invoice is being rendered.
 * - business_header: TRUE if the invoice header should be displayed.
 * - shipping_method: TRUE if shipping information should be displayed.
 * - help_text: TRUE if the store help message should be displayed.
 * - email_text: TRUE if the "do not reply to this email" message should
 *   be displayed.
 * - store_footer: TRUE if the store URL should be displayed.
 * - thank_you_message: TRUE if the 'thank you for your order' message
 *   should be displayed.
 *
 * @see template_preprocess_uc_order()
 */
#}
<table width="95%" border="0" cellspacing="0" cellpadding="1" align="center" bgcolor="#006699" style="font-family: verdana, arial, helvetica; font-size: small;">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="5" align="center" bgcolor="#FFFFFF" style="font-family: verdana, arial, helvetica; font-size: small;">
        {% if business_header %}
        <tr valign="top">
          <td>
            <table width="100%" style="font-family: verdana, arial, helvetica; font-size: small;">
              <tr>
                <td>{{ site_logo }}</td>
                <td width="98%">
                  <div style="padding-left: 1em;">
                  <span style="font-size: large;">{{ store_name }}</span><br />
                  {{ site_slogan }}
                  </div>
                </td>
                <td nowrap="nowrap">{{ store_address }}<br />{{ store_phone }}</td>
              </tr>
            </table>
          </td>
        </tr>
        {% endif %}

        <tr valign="top">
          <td>
            {% if thank_you_message %}
            <p><b>{{ 'Thanks for your order, @order_first_name!'|t({'@order_first_name': order_first_name}) }}</b></p>

            {% if order.data.new_user_name %}
            <p><b>{{ 'An account has been created for you with the following details:'|t }}</b></p>
            <p><b>{{ 'Username:'|t }}</b> {{ order_new_username }}<br />
            <b>{{ 'Password:'|t }}</b> {{ order_new_password }}</p>
            {% endif %}

            <p><b>{{ 'Want to manage your order online?'|t }}</b><br />
            {{ 'If you need to check the status of your order, please visit our home page at @store_link and click on "My account" in the menu or login with the following link:'|t({'@store_link': store_link}) }}
            <br /><br />{{ site_login_link }}</p>
            {% endif %}

            <table cellpadding="4" cellspacing="0" border="0" width="100%" style="font-family: verdana, arial, helvetica; font-size: small;">
              <tr>
                <td colspan="2" bgcolor="#006699" style="color: white;">
                  <b>{{ 'Purchasing Information:'|t }}</b>
                </td>
              </tr>
              <tr>
                <td nowrap="nowrap"><b>{{ 'E-mail Address:'|t }}</b></td>
                <td width="98%">{{ order_email }}</td>
              </tr>
              <tr>
                <td colspan="2">
                  <table width="100%" cellspacing="0" cellpadding="0" style="font-family: verdana, arial, helvetica; font-size: small;">
                    <tr>
                      <td valign="top" width="50%">
                        <b>{{ 'Billing Address:'|t }}</b><br />
                        {{ order_billing_address }}<br />
                        <br />
                        <b>{{ 'Billing Phone:'|t }}</b><br />
                        {{ order_billing_phone }}<br />
                      </td>
                      {% if shippable %}
                      <td valign="top" width="50%">
                        <b>{{ 'Shipping Address:'|t }}</b><br />
                        {{ order_shipping_address }}<br />
                        <br />
                        <b>{{ 'Shipping Phone:'|t }}</b><br />
                        {{ order_shipping_phone }}<br />
                      </td>
                      {% endif %}
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td nowrap="nowrap">
                  <b>{{ 'Order Grand Total:'|t }}</b>
                </td>
                <td width="98%">
                  <b>{{ order_total }}</b>
                </td>
              </tr>

              {% if order_payment_method %}
              <tr>
                <td nowrap="nowrap"><b>{{ 'Payment Method:'|t }}</b></td>
                <td width="98%">{{ order_payment_method }}</td>
              </tr>
              {% endif %}

              <tr>
                <td colspan="2" bgcolor="#006699" style="color: white;">
                  <b>{{ 'Order Summary:'|t }}</b>
                </td>
              </tr>

              {% if shippable %}
              <tr>
                <td colspan="2" bgcolor="#EEEEEE">
                  <font color="#CC6600"><b>{{ 'Shipping Details:'|t }}</b></font>
                </td>
              </tr>
              {% endif %}

              <tr>
                <td colspan="2">

                  <table border="0" cellpadding="1" cellspacing="0" width="100%" style="font-family: verdana, arial, helvetica; font-size: small;">
                    <tr>
                      <td nowrap="nowrap"><b>{{ 'Order #:'|t }}</b></td>
                      <td width="98%">{{ order_link }}</td>
                    </tr>

                    <tr>
                      <td nowrap="nowrap"><b>{{ 'Order Date: '|t }}</b></td>
                      <td width="98%">{{ order_created }}</td>
                    </tr>

                    {% if shipping_method and shippable %}
                    <tr>
                      <td nowrap="nowrap"><b>{{ 'Shipping Method:'|t }}</b></td>
                      <td width="98%">{{ order_shipping_method }}</td>
                    </tr>
                    {% endif %}

                    <tr>
                      <td nowrap="nowrap">{{ 'Products Subtotal:'|t }}&nbsp;</td>
                      <td width="98%">{{ order_subtotal }}</td>
                    </tr>

                    {% for item in line_items if item.type != 'subtotal' and item.type != 'total' %}

                    <tr>
                      <td nowrap="nowrap">{{ item.title }}:</td>
                      <td>{{ item.formatted_amount }}</td>
                    </tr>

                    {% endfor %}

                    <tr>
                      <td>&nbsp;</td>
                      <td>------</td>
                    </tr>

                    <tr>
                      <td nowrap="nowrap"><b>{{ 'Total for this Order:'|t }}&nbsp;</b></td>
                      <td><b>{{ order_total }}</b></td>
                    </tr>

                    <tr>
                      <td colspan="2">
                        <br /><br /><b>{{ 'Products on order:'|t }}&nbsp;</b>

                        <table width="100%" style="font-family: verdana, arial, helvetica; font-size: small;">

                          {% for product in products %}
                          <tr>
                            <td valign="top" nowrap="nowrap"><b>{{ product.qty }} x </b></td>
                            <td width="98%">
                              <b>{{ product.title }} - {{ product.total_price }}</b>
                              {{ product.individual_price }}<br />
                              {{ 'SKU'|t }}: {{ product.model }}<br />
                              {{ product.details }}
                            </td>
                          </tr>
                          {% endfor %}
                        </table>

                      </td>
                    </tr>
                  </table>

                </td>
              </tr>

              {% if help_text or email_text or store_footer %}
              <tr>
                <td colspan="2">
                  <hr noshade="noshade" size="1" /><br />

                  {% if help_text %}
                  <p><b>{{ 'Where can I get help with reviewing my order?'|t }}</b><br />
                  {{ 'To learn more about managing your orders on @store_link, please visit our <a href="@store_help_url">help page</a>.'|t({'@store_link': store_link, '@store_help_url': store_help_url}) }}
                  <br /></p>
                  {% endif %}

                  {% if email_text %}
                  <p>{{ 'Please note: This e-mail message is an automated notification. Please do not reply to this message.'|t }}</p>

                  <p>{{ 'Thanks again for shopping with us.'|t }}</p>
                  {% endif %}

                  {% if store_footer %}
                  <p><b>{{ store_link }}</b><br /><b>{{ site_slogan }}</b></p>
                  {% endif %}
                </td>
              </tr>
              {% endif %}

            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>

File

uc_order/templates/uc-order-invoice.html.twig
View source
  1. {#
  2. * This file is the default customer invoice template for Ubercart.
  3. *
  4. * Available variables:
  5. * - products: An array of product objects in the order, with the following
  6. * members:
  7. * - title: The product title.
  8. * - model: The product SKU.
  9. * - qty: The quantity ordered.
  10. * - total_price: The formatted total price for the quantity ordered.
  11. * - individual_price: If quantity is more than 1, the formatted product
  12. * price of a single item.
  13. * - details: Any extra details about the product, such as attributes.
  14. * - line_items: An array of line item arrays attached to the order, each with
  15. * the following keys:
  16. * - type: The type of line item (subtotal, shipping, etc.).
  17. * - title: The line item display title.
  18. * - formatted_amount: The formatted amount of the line item.
  19. * - shippable: TRUE if the order is shippable.
  20. *
  21. * Tokens: All site, store and order tokens are also available as
  22. * variables, such as site_logo, store_name and order_first_name.
  23. *
  24. * Display options:
  25. * - op: 'view', 'print', 'checkout-mail' or 'admin-mail', depending on
  26. * which variant of the invoice is being rendered.
  27. * - business_header: TRUE if the invoice header should be displayed.
  28. * - shipping_method: TRUE if shipping information should be displayed.
  29. * - help_text: TRUE if the store help message should be displayed.
  30. * - email_text: TRUE if the "do not reply to this email" message should
  31. * be displayed.
  32. * - store_footer: TRUE if the store URL should be displayed.
  33. * - thank_you_message: TRUE if the 'thank you for your order' message
  34. * should be displayed.
  35. *
  36. * @see template_preprocess_uc_order()
  37. */
  38. #}
  39. <table width="95%" border="0" cellspacing="0" cellpadding="1" align="center" bgcolor="#006699" style="font-family: verdana, arial, helvetica; font-size: small;">
  40. <tr>
  41. <td>
  42. <table width="100%" border="0" cellspacing="0" cellpadding="5" align="center" bgcolor="#FFFFFF" style="font-family: verdana, arial, helvetica; font-size: small;">
  43. {% if business_header %}
  44. <tr valign="top">
  45. <td>
  46. <table width="100%" style="font-family: verdana, arial, helvetica; font-size: small;">
  47. <tr>
  48. <td>{{ site_logo }}</td>
  49. <td width="98%">
  50. <div style="padding-left: 1em;">
  51. <span style="font-size: large;">{{ store_name }}</span><br />
  52. {{ site_slogan }}
  53. </div>
  54. </td>
  55. <td nowrap="nowrap">{{ store_address }}<br />{{ store_phone }}</td>
  56. </tr>
  57. </table>
  58. </td>
  59. </tr>
  60. {% endif %}
  61. <tr valign="top">
  62. <td>
  63. {% if thank_you_message %}
  64. <p><b>{{ 'Thanks for your order, @order_first_name!'|t({'@order_first_name': order_first_name}) }}</b></p>
  65. {% if order.data.new_user_name %}
  66. <p><b>{{ 'An account has been created for you with the following details:'|t }}</b></p>
  67. <p><b>{{ 'Username:'|t }}</b> {{ order_new_username }}<br />
  68. <b>{{ 'Password:'|t }}</b> {{ order_new_password }}</p>
  69. {% endif %}
  70. <p><b>{{ 'Want to manage your order online?'|t }}</b><br />
  71. {{ 'If you need to check the status of your order, please visit our home page at @store_link and click on "My account" in the menu or login with the following link:'|t({'@store_link': store_link}) }}
  72. <br /><br />{{ site_login_link }}</p>
  73. {% endif %}
  74. <table cellpadding="4" cellspacing="0" border="0" width="100%" style="font-family: verdana, arial, helvetica; font-size: small;">
  75. <tr>
  76. <td colspan="2" bgcolor="#006699" style="color: white;">
  77. <b>{{ 'Purchasing Information:'|t }}</b>
  78. </td>
  79. </tr>
  80. <tr>
  81. <td nowrap="nowrap"><b>{{ 'E-mail Address:'|t }}</b></td>
  82. <td width="98%">{{ order_email }}</td>
  83. </tr>
  84. <tr>
  85. <td colspan="2">
  86. <table width="100%" cellspacing="0" cellpadding="0" style="font-family: verdana, arial, helvetica; font-size: small;">
  87. <tr>
  88. <td valign="top" width="50%">
  89. <b>{{ 'Billing Address:'|t }}</b><br />
  90. {{ order_billing_address }}<br />
  91. <br />
  92. <b>{{ 'Billing Phone:'|t }}</b><br />
  93. {{ order_billing_phone }}<br />
  94. </td>
  95. {% if shippable %}
  96. <td valign="top" width="50%">
  97. <b>{{ 'Shipping Address:'|t }}</b><br />
  98. {{ order_shipping_address }}<br />
  99. <br />
  100. <b>{{ 'Shipping Phone:'|t }}</b><br />
  101. {{ order_shipping_phone }}<br />
  102. </td>
  103. {% endif %}
  104. </tr>
  105. </table>
  106. </td>
  107. </tr>
  108. <tr>
  109. <td nowrap="nowrap">
  110. <b>{{ 'Order Grand Total:'|t }}</b>
  111. </td>
  112. <td width="98%">
  113. <b>{{ order_total }}</b>
  114. </td>
  115. </tr>
  116. {% if order_payment_method %}
  117. <tr>
  118. <td nowrap="nowrap"><b>{{ 'Payment Method:'|t }}</b></td>
  119. <td width="98%">{{ order_payment_method }}</td>
  120. </tr>
  121. {% endif %}
  122. <tr>
  123. <td colspan="2" bgcolor="#006699" style="color: white;">
  124. <b>{{ 'Order Summary:'|t }}</b>
  125. </td>
  126. </tr>
  127. {% if shippable %}
  128. <tr>
  129. <td colspan="2" bgcolor="#EEEEEE">
  130. <font color="#CC6600"><b>{{ 'Shipping Details:'|t }}</b></font>
  131. </td>
  132. </tr>
  133. {% endif %}
  134. <tr>
  135. <td colspan="2">
  136. <table border="0" cellpadding="1" cellspacing="0" width="100%" style="font-family: verdana, arial, helvetica; font-size: small;">
  137. <tr>
  138. <td nowrap="nowrap"><b>{{ 'Order #:'|t }}</b></td>
  139. <td width="98%">{{ order_link }}</td>
  140. </tr>
  141. <tr>
  142. <td nowrap="nowrap"><b>{{ 'Order Date: '|t }}</b></td>
  143. <td width="98%">{{ order_created }}</td>
  144. </tr>
  145. {% if shipping_method and shippable %}
  146. <tr>
  147. <td nowrap="nowrap"><b>{{ 'Shipping Method:'|t }}</b></td>
  148. <td width="98%">{{ order_shipping_method }}</td>
  149. </tr>
  150. {% endif %}
  151. <tr>
  152. <td nowrap="nowrap">{{ 'Products Subtotal:'|t }}&nbsp;</td>
  153. <td width="98%">{{ order_subtotal }}</td>
  154. </tr>
  155. {% for item in line_items if item.type != 'subtotal' and item.type != 'total' %}
  156. <tr>
  157. <td nowrap="nowrap">{{ item.title }}:</td>
  158. <td>{{ item.formatted_amount }}</td>
  159. </tr>
  160. {% endfor %}
  161. <tr>
  162. <td>&nbsp;</td>
  163. <td>------</td>
  164. </tr>
  165. <tr>
  166. <td nowrap="nowrap"><b>{{ 'Total for this Order:'|t }}&nbsp;</b></td>
  167. <td><b>{{ order_total }}</b></td>
  168. </tr>
  169. <tr>
  170. <td colspan="2">
  171. <br /><br /><b>{{ 'Products on order:'|t }}&nbsp;</b>
  172. <table width="100%" style="font-family: verdana, arial, helvetica; font-size: small;">
  173. {% for product in products %}
  174. <tr>
  175. <td valign="top" nowrap="nowrap"><b>{{ product.qty }} x </b></td>
  176. <td width="98%">
  177. <b>{{ product.title }} - {{ product.total_price }}</b>
  178. {{ product.individual_price }}<br />
  179. {{ 'SKU'|t }}: {{ product.model }}<br />
  180. {{ product.details }}
  181. </td>
  182. </tr>
  183. {% endfor %}
  184. </table>
  185. </td>
  186. </tr>
  187. </table>
  188. </td>
  189. </tr>
  190. {% if help_text or email_text or store_footer %}
  191. <tr>
  192. <td colspan="2">
  193. <hr noshade="noshade" size="1" /><br />
  194. {% if help_text %}
  195. <p><b>{{ 'Where can I get help with reviewing my order?'|t }}</b><br />
  196. {{ 'To learn more about managing your orders on @store_link, please visit our <a href="@store_help_url">help page</a>.'|t({'@store_link': store_link, '@store_help_url': store_help_url}) }}
  197. <br /></p>
  198. {% endif %}
  199. {% if email_text %}
  200. <p>{{ 'Please note: This e-mail message is an automated notification. Please do not reply to this message.'|t }}</p>
  201. <p>{{ 'Thanks again for shopping with us.'|t }}</p>
  202. {% endif %}
  203. {% if store_footer %}
  204. <p><b>{{ store_link }}</b><br /><b>{{ site_slogan }}</b></p>
  205. {% endif %}
  206. </td>
  207. </tr>
  208. {% endif %}
  209. </table>
  210. </td>
  211. </tr>
  212. </table>
  213. </td>
  214. </tr>
  215. </table>