plain
3 years ago
admin-cancelled-order.php
5 years ago
admin-failed-order.php
5 years ago
admin-new-order.php
5 years ago
customer-completed-order.php
5 years ago
customer-invoice.php
4 years ago
customer-new-account.php
4 years ago
customer-note.php
5 years ago
customer-on-hold-order.php
3 years ago
customer-processing-order.php
5 years ago
customer-refunded-order.php
5 years ago
customer-reset-password.php
5 years ago
email-addresses.php
4 years ago
email-customer-details.php
5 years ago
email-downloads.php
5 years ago
email-footer.php
3 years ago
email-header.php
3 years ago
email-mobile-messaging.php
3 years ago
email-order-details.php
5 years ago
email-order-items.php
5 years ago
email-styles.php
3 years ago
email-order-details.php
91 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Order details table shown in emails. |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-details.php. |
| 6 | * |
| 7 | * HOWEVER, on occasion WooCommerce will need to update template files and you |
| 8 | * (the theme developer) will need to copy the new files to your theme to |
| 9 | * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | * happen. When this occurs the version of the template file will be bumped and |
| 11 | * the readme will list any important changes. |
| 12 | * |
| 13 | * @see https://docs.woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce\Templates\Emails |
| 15 | * @version 3.7.0 |
| 16 | */ |
| 17 | |
| 18 | defined( 'ABSPATH' ) || exit; |
| 19 | |
| 20 | $text_align = is_rtl() ? 'right' : 'left'; |
| 21 | |
| 22 | do_action( 'woocommerce_email_before_order_table', $order, $sent_to_admin, $plain_text, $email ); ?> |
| 23 | |
| 24 | <h2> |
| 25 | <?php |
| 26 | if ( $sent_to_admin ) { |
| 27 | $before = '<a class="link" href="' . esc_url( $order->get_edit_order_url() ) . '">'; |
| 28 | $after = '</a>'; |
| 29 | } else { |
| 30 | $before = ''; |
| 31 | $after = ''; |
| 32 | } |
| 33 | /* translators: %s: Order ID. */ |
| 34 | echo wp_kses_post( $before . sprintf( __( '[Order #%s]', 'woocommerce' ) . $after . ' (<time datetime="%s">%s</time>)', $order->get_order_number(), $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ) ); |
| 35 | ?> |
| 36 | </h2> |
| 37 | |
| 38 | <div style="margin-bottom: 40px;"> |
| 39 | <table class="td" cellspacing="0" cellpadding="6" style="width: 100%; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;" border="1"> |
| 40 | <thead> |
| 41 | <tr> |
| 42 | <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Product', 'woocommerce' ); ?></th> |
| 43 | <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Quantity', 'woocommerce' ); ?></th> |
| 44 | <th class="td" scope="col" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Price', 'woocommerce' ); ?></th> |
| 45 | </tr> |
| 46 | </thead> |
| 47 | <tbody> |
| 48 | <?php |
| 49 | echo wc_get_email_order_items( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 50 | $order, |
| 51 | array( |
| 52 | 'show_sku' => $sent_to_admin, |
| 53 | 'show_image' => false, |
| 54 | 'image_size' => array( 32, 32 ), |
| 55 | 'plain_text' => $plain_text, |
| 56 | 'sent_to_admin' => $sent_to_admin, |
| 57 | ) |
| 58 | ); |
| 59 | ?> |
| 60 | </tbody> |
| 61 | <tfoot> |
| 62 | <?php |
| 63 | $item_totals = $order->get_order_item_totals(); |
| 64 | |
| 65 | if ( $item_totals ) { |
| 66 | $i = 0; |
| 67 | foreach ( $item_totals as $total ) { |
| 68 | $i++; |
| 69 | ?> |
| 70 | <tr> |
| 71 | <th class="td" scope="row" colspan="2" style="text-align:<?php echo esc_attr( $text_align ); ?>; <?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>"><?php echo wp_kses_post( $total['label'] ); ?></th> |
| 72 | <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; <?php echo ( 1 === $i ) ? 'border-top-width: 4px;' : ''; ?>"><?php echo wp_kses_post( $total['value'] ); ?></td> |
| 73 | </tr> |
| 74 | <?php |
| 75 | } |
| 76 | } |
| 77 | if ( $order->get_customer_note() ) { |
| 78 | ?> |
| 79 | <tr> |
| 80 | <th class="td" scope="row" colspan="2" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php esc_html_e( 'Note:', 'woocommerce' ); ?></th> |
| 81 | <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>;"><?php echo wp_kses_post( nl2br( wptexturize( $order->get_customer_note() ) ) ); ?></td> |
| 82 | </tr> |
| 83 | <?php |
| 84 | } |
| 85 | ?> |
| 86 | </tfoot> |
| 87 | </table> |
| 88 | </div> |
| 89 | |
| 90 | <?php do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email ); ?> |
| 91 |