plain
2 years ago
admin-cancelled-order.php
2 years ago
admin-failed-order.php
2 years ago
admin-new-order.php
2 years ago
customer-completed-order.php
2 years ago
customer-invoice.php
2 years ago
customer-new-account-blocks.php
2 years ago
customer-new-account.php
2 years ago
customer-note.php
2 years ago
customer-on-hold-order.php
2 years ago
customer-processing-order.php
2 years ago
customer-refunded-order.php
2 years ago
customer-reset-password.php
2 years ago
email-addresses.php
2 years ago
email-customer-details.php
2 years ago
email-downloads.php
2 years ago
email-footer.php
2 years ago
email-header.php
2 years ago
email-mobile-messaging.php
2 years ago
email-order-details.php
2 years ago
email-order-items.php
2 years ago
email-styles.php
2 years ago
email-order-items.php
105 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Email Order Items |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/woocommerce/emails/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://woo.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 | $margin_side = is_rtl() ? 'left' : 'right'; |
| 22 | |
| 23 | foreach ( $items as $item_id => $item ) : |
| 24 | $product = $item->get_product(); |
| 25 | $sku = ''; |
| 26 | $purchase_note = ''; |
| 27 | $image = ''; |
| 28 | |
| 29 | if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) { |
| 30 | continue; |
| 31 | } |
| 32 | |
| 33 | if ( is_object( $product ) ) { |
| 34 | $sku = $product->get_sku(); |
| 35 | $purchase_note = $product->get_purchase_note(); |
| 36 | $image = $product->get_image( $image_size ); |
| 37 | } |
| 38 | |
| 39 | ?> |
| 40 | <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>"> |
| 41 | <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align: middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif; word-wrap:break-word;"> |
| 42 | <?php |
| 43 | |
| 44 | // Show title/image etc. |
| 45 | if ( $show_image ) { |
| 46 | echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) ); |
| 47 | } |
| 48 | |
| 49 | // Product name. |
| 50 | echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) ); |
| 51 | |
| 52 | // SKU. |
| 53 | if ( $show_sku && $sku ) { |
| 54 | echo wp_kses_post( ' (#' . $sku . ')' ); |
| 55 | } |
| 56 | |
| 57 | // allow other plugins to add additional product information here. |
| 58 | do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text ); |
| 59 | |
| 60 | wc_display_item_meta( |
| 61 | $item, |
| 62 | array( |
| 63 | 'label_before' => '<strong class="wc-item-meta-label" style="float: ' . esc_attr( $text_align ) . '; margin-' . esc_attr( $margin_side ) . ': .25em; clear: both">', |
| 64 | ) |
| 65 | ); |
| 66 | |
| 67 | // allow other plugins to add additional product information here. |
| 68 | do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text ); |
| 69 | |
| 70 | ?> |
| 71 | </td> |
| 72 | <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;"> |
| 73 | <?php |
| 74 | $qty = $item->get_quantity(); |
| 75 | $refunded_qty = $order->get_qty_refunded_for_item( $item_id ); |
| 76 | |
| 77 | if ( $refunded_qty ) { |
| 78 | $qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '</ins>'; |
| 79 | } else { |
| 80 | $qty_display = esc_html( $qty ); |
| 81 | } |
| 82 | echo wp_kses_post( apply_filters( 'woocommerce_email_order_item_quantity', $qty_display, $item ) ); |
| 83 | ?> |
| 84 | </td> |
| 85 | <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;"> |
| 86 | <?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?> |
| 87 | </td> |
| 88 | </tr> |
| 89 | <?php |
| 90 | |
| 91 | if ( $show_purchase_note && $purchase_note ) { |
| 92 | ?> |
| 93 | <tr> |
| 94 | <td colspan="3" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;"> |
| 95 | <?php |
| 96 | echo wp_kses_post( wpautop( do_shortcode( $purchase_note ) ) ); |
| 97 | ?> |
| 98 | </td> |
| 99 | </tr> |
| 100 | <?php |
| 101 | } |
| 102 | ?> |
| 103 | |
| 104 | <?php endforeach; ?> |
| 105 |