admin-cancelled-order.php
1 year ago
admin-failed-order.php
1 year ago
admin-new-order.php
1 year ago
admin-payment-gateway-enabled.php
2 months ago
customer-cancelled-order.php
1 year ago
customer-completed-order.php
1 year ago
customer-failed-order.php
1 year ago
customer-fulfillment-created.php
11 months ago
customer-fulfillment-deleted.php
11 months ago
customer-fulfillment-updated.php
1 month ago
customer-invoice.php
1 year ago
customer-new-account.php
1 year ago
customer-note.php
11 months ago
customer-on-hold-order.php
1 year ago
customer-pos-completed-order.php
1 year ago
customer-pos-refunded-order.php
1 year ago
customer-processing-order.php
1 year ago
customer-refunded-order.php
1 year ago
customer-reset-password.php
1 year 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
11 months ago
email-fulfillment-items.php
1 month ago
email-order-details.php
1 month ago
email-order-items.php
1 month ago
email-fulfillment-items.php
81 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Email Fulfillment Items (plain) |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/emails/plain/email-fulfillment-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://woocommerce.com/document/template-structure/ |
| 14 | * @package WooCommerce\Templates\Emails\Plain |
| 15 | * @version 10.8.0 |
| 16 | */ |
| 17 | |
| 18 | if ( ! defined( 'ABSPATH' ) ) { |
| 19 | exit; // Exit if accessed directly. |
| 20 | } |
| 21 | |
| 22 | foreach ( $items as $item_id => $item ) : |
| 23 | /** |
| 24 | * Email Order Item Visibility hook. |
| 25 | * |
| 26 | * @since 2.5.0 |
| 27 | * @param $visible Whether the item is visible in the email. |
| 28 | * @param WC_Order_Item_Product $item The order item object. |
| 29 | * |
| 30 | * @return bool |
| 31 | */ |
| 32 | if ( apply_filters( |
| 33 | 'woocommerce_order_item_visible', |
| 34 | true, |
| 35 | $item->item |
| 36 | ) ) { |
| 37 | $product = $item->item->get_product(); |
| 38 | $sku = ''; |
| 39 | $purchase_note = ''; |
| 40 | |
| 41 | if ( is_object( $product ) ) { |
| 42 | $sku = $product->get_sku(); |
| 43 | $purchase_note = $product->get_purchase_note(); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Email Order Item Name hook. |
| 48 | * |
| 49 | * @since 2.1.0 |
| 50 | * @since 2.4.0 Added $is_visible parameter. |
| 51 | * @param string $product_name Product name. |
| 52 | * @param WC_Order_Item $item Order item object. |
| 53 | * @param bool $is_visible Is item visible. |
| 54 | */ |
| 55 | $product_name = apply_filters( 'woocommerce_order_item_name', $item->item->get_name(), $item->item, false ); |
| 56 | /** |
| 57 | * Email Order Item Quantity hook. |
| 58 | * |
| 59 | * @since 2.4.0 |
| 60 | * @param int $quantity Item quantity. |
| 61 | * @param WC_Order_Item $item Item object. |
| 62 | */ |
| 63 | $quantity = apply_filters( 'woocommerce_email_order_item_quantity', $item->qty, $item->item ); |
| 64 | if ( '' !== $quantity ) { |
| 65 | $product_name .= ' × ' . $quantity; |
| 66 | } |
| 67 | echo wp_kses_post( str_pad( wp_kses_post( $product_name ), 40 ) ); |
| 68 | echo ' '; |
| 69 | echo esc_html( str_pad( wp_kses( $order->get_formatted_line_subtotal( $item->item ), array() ), 20, ' ', STR_PAD_LEFT ) ) . "\n"; |
| 70 | |
| 71 | // SKU. |
| 72 | if ( $show_sku && $sku ) { |
| 73 | echo esc_html( '(#' . $sku . ")\n" ); |
| 74 | } |
| 75 | } |
| 76 | // Note. |
| 77 | if ( $show_purchase_note && $purchase_note ) { |
| 78 | echo "\n" . do_shortcode( wp_kses_post( $purchase_note ) ); |
| 79 | } |
| 80 | endforeach; |
| 81 |