admin-cancelled-order.php
1 year ago
admin-failed-order.php
1 year ago
admin-new-order.php
11 months ago
admin-payment-gateway-enabled.php
2 months ago
customer-cancelled-order.php
11 months ago
customer-completed-order.php
1 year ago
customer-failed-order.php
1 year ago
customer-fulfillment-created.php
10 months ago
customer-fulfillment-deleted.php
10 months ago
customer-fulfillment-updated.php
1 month ago
customer-invoice.php
1 year ago
customer-new-account.php
11 months ago
customer-note.php
10 months ago
customer-on-hold-order.php
1 year ago
customer-pos-completed-order.php
11 months ago
customer-pos-refunded-order.php
11 months ago
customer-processing-order.php
1 year ago
customer-refunded-order.php
1 year ago
customer-reset-password.php
1 year ago
customer-review-request.php
3 weeks ago
customer-stock-notification-verified.php
9 months ago
customer-stock-notification-verify.php
9 months ago
customer-stock-notification.php
9 months ago
email-addresses.php
2 years ago
email-customer-details.php
2 years ago
email-downloads.php
2 years ago
email-fulfillment-details.php
10 months ago
email-fulfillment-items.php
1 month ago
email-order-details.php
1 month ago
email-order-items.php
1 month ago
customer-invoice.php
96 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Customer invoice email (plain text) |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/customer-invoice.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://woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce\Templates\Emails\Plain |
| 15 | * @version 9.7.0 |
| 16 | */ |
| 17 | |
| 18 | // phpcs:disable Universal.WhiteSpace.PrecisionAlignment.Found, Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed -- Plain text output needs specific spacing without tabs |
| 19 | |
| 20 | use Automattic\WooCommerce\Enums\OrderStatus; |
| 21 | |
| 22 | defined( 'ABSPATH' ) || exit; |
| 23 | |
| 24 | echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n"; |
| 25 | echo esc_html( wp_strip_all_tags( $email_heading ) ); |
| 26 | echo "\n=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n\n"; |
| 27 | |
| 28 | /* translators: %s: Customer first name */ |
| 29 | echo sprintf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ) . "\n\n"; |
| 30 | |
| 31 | if ( $order->needs_payment() ) { |
| 32 | if ( $order->has_status( OrderStatus::FAILED ) ) { |
| 33 | echo wp_kses_post( |
| 34 | sprintf( |
| 35 | /* translators: %1$s: Site title, %2$s: Order pay link */ |
| 36 | __( 'Sorry, your order on %1$s was unsuccessful. Your order details are below, with a link to try your payment again: %2$s', 'woocommerce' ), |
| 37 | esc_html( get_bloginfo( 'name', 'display' ) ), |
| 38 | esc_url( $order->get_checkout_payment_url() ) |
| 39 | ) |
| 40 | ) . "\n\n"; |
| 41 | } else { |
| 42 | echo wp_kses_post( |
| 43 | sprintf( |
| 44 | /* translators: %1$s: Site title, %2$s: Order pay link */ |
| 45 | __( 'An order has been created for you on %1$s. Your order details are below, with a link to make payment when you’re ready: %2$s', 'woocommerce' ), |
| 46 | esc_html( get_bloginfo( 'name', 'display' ) ), |
| 47 | esc_url( $order->get_checkout_payment_url() ) |
| 48 | ) |
| 49 | ) . "\n\n"; |
| 50 | } |
| 51 | } else { |
| 52 | /* translators: %s: Order date */ |
| 53 | echo sprintf( esc_html__( 'Here are the details of your order placed on %s:', 'woocommerce' ), esc_html( wc_format_datetime( $order->get_date_created() ) ) ) . "\n\n"; |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Hook for the woocommerce_email_order_details. |
| 58 | * |
| 59 | * @hooked WC_Emails::order_details() Shows the order details table. |
| 60 | * @hooked WC_Structured_Data::generate_order_data() Generates structured data. |
| 61 | * @hooked WC_Structured_Data::output_structured_data() Outputs structured data. |
| 62 | * @since 2.5.0 |
| 63 | */ |
| 64 | do_action( 'woocommerce_email_order_details', $order, $sent_to_admin, $plain_text, $email ); |
| 65 | |
| 66 | echo "\n----------------------------------------\n\n"; |
| 67 | |
| 68 | /** |
| 69 | * Hook for the woocommerce_email_order_meta. |
| 70 | * |
| 71 | * @hooked WC_Emails::order_meta() Shows order meta data. |
| 72 | */ |
| 73 | do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, $email ); |
| 74 | |
| 75 | /** |
| 76 | * Hook for woocommerce_email_customer_details |
| 77 | * |
| 78 | * @hooked WC_Emails::customer_details() Shows customer details |
| 79 | * @hooked WC_Emails::email_address() Shows email address |
| 80 | */ |
| 81 | do_action( 'woocommerce_email_customer_details', $order, $sent_to_admin, $plain_text, $email ); |
| 82 | |
| 83 | echo "\n\n----------------------------------------\n\n"; |
| 84 | |
| 85 | /** |
| 86 | * Show user-defined additional content - this is set in each email's settings. |
| 87 | */ |
| 88 | if ( $additional_content ) { |
| 89 | echo esc_html( wp_strip_all_tags( wptexturize( $additional_content ) ) ); |
| 90 | echo "\n\n----------------------------------------\n\n"; |
| 91 | } |
| 92 | |
| 93 | echo wp_kses_post( apply_filters( 'woocommerce_email_footer_text', get_option( 'woocommerce_email_footer_text' ) ) ); |
| 94 | |
| 95 | // phpcs:enable Universal.WhiteSpace.PrecisionAlignment.Found, Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed |
| 96 |