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
5 years ago
customer-new-account.php
4 years ago
customer-note.php
5 years ago
customer-on-hold-order.php
5 years ago
customer-processing-order.php
5 years ago
customer-refunded-order.php
4 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-order-details.php
5 years ago
email-order-items.php
5 years ago
email-order-items.php
67 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Email Order Items (plain) |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-order-items.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\Plain |
| 15 | * @version 5.2.0 |
| 16 | */ |
| 17 | |
| 18 | if ( ! defined( 'ABSPATH' ) ) { |
| 19 | exit; // Exit if accessed directly. |
| 20 | } |
| 21 | |
| 22 | foreach ( $items as $item_id => $item ) : |
| 23 | if ( apply_filters( 'woocommerce_order_item_visible', true, $item ) ) { |
| 24 | $product = $item->get_product(); |
| 25 | $sku = ''; |
| 26 | $purchase_note = ''; |
| 27 | |
| 28 | if ( is_object( $product ) ) { |
| 29 | $sku = $product->get_sku(); |
| 30 | $purchase_note = $product->get_purchase_note(); |
| 31 | } |
| 32 | |
| 33 | // phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped |
| 34 | echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ); |
| 35 | if ( $show_sku && $sku ) { |
| 36 | echo ' (#' . $sku . ')'; |
| 37 | } |
| 38 | echo ' X ' . apply_filters( 'woocommerce_email_order_item_quantity', $item->get_quantity(), $item ); |
| 39 | echo ' = ' . $order->get_formatted_line_subtotal( $item ) . "\n"; |
| 40 | // phpcs:enable WordPress.Security.EscapeOutput.OutputNotEscaped |
| 41 | |
| 42 | // allow other plugins to add additional product information here. |
| 43 | do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text ); |
| 44 | // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 45 | echo strip_tags( |
| 46 | wc_display_item_meta( |
| 47 | $item, |
| 48 | array( |
| 49 | 'before' => "\n- ", |
| 50 | 'separator' => "\n- ", |
| 51 | 'after' => '', |
| 52 | 'echo' => false, |
| 53 | 'autop' => false, |
| 54 | ) |
| 55 | ) |
| 56 | ); |
| 57 | |
| 58 | // allow other plugins to add additional product information here. |
| 59 | do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text ); |
| 60 | } |
| 61 | // Note. |
| 62 | if ( $show_purchase_note && $purchase_note ) { |
| 63 | echo "\n" . do_shortcode( wp_kses_post( $purchase_note ) ); |
| 64 | } |
| 65 | echo "\n\n"; |
| 66 | endforeach; |
| 67 |