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3.2.1 6.3.0-beta.1 3.2.2 6.3.0-rc.1 3.2.3 6.3.0-rc.2 3.2.4 6.3.1 3.2.5 6.3.2 3.2.6 6.4.0 3.3.0 6.4.0-beta.1 3.3.1 6.4.0-rc.1 3.3.2 6.4.1 3.3.2-rc.1 6.4.2 3.3.3 6.5.0 3.3.4 6.5.0-beta.1 3.3.5 6.5.0-rc.1 3.3.6 6.5.0-rc.2 3.4.0 6.5.1 3.4.0-beta.1 6.5.2 3.4.0-rc.2 6.6.0 3.4.1 6.6.0-beta.1 3.4.2 6.6.0-rc.1 3.4.3 6.6.0-rc.2 3.4.4 6.6.1 3.4.5 6.6.2 3.4.6 6.7.0 3.4.7 6.7.0-beta.1 3.4.8 6.7.0-beta.2 3.5.0 6.7.0-rc.1 3.5.0-beta.1 6.7.1 3.5.0-rc.1 6.8.0 3.5.0-rc.2 6.8.0-beta.1 3.5.1 6.8.0-beta.2 3.5.10 6.8.0-rc.1 3.5.2 6.8.1 3.5.3 6.8.2 3.5.4 6.8.3 3.5.5 6.9.0 3.5.6 6.9.0-beta.1 3.5.7 6.9.0-beta.2 3.5.8 6.9.0-rc.1 3.5.9 6.9.1 3.6.0 6.9.2 3.6.0-beta.1 6.9.3 3.6.0-rc.1 6.9.4 3.6.0-rc.2 6.9.5 3.6.0-rc.3 7.0.0 3.6.1 7.0.0-beta.1 3.6.2 7.0.0-beta.2 3.6.3 7.0.0-beta.3 3.6.4 7.0.0-rc.1 3.6.5 7.0.0-rc.2 3.6.6 7.0.1 3.6.7 7.0.2 3.7.0 7.1.0 3.7.0-beta.1 7.1.0-beta.1 3.7.0-rc.1 7.1.0-beta.2 3.7.0-rc.2 7.1.0-rc.1 3.7.1 7.1.0-rc.2 3.7.2 7.1.1
woocommerce / templates / emails / email-order-items.php
woocommerce / templates / emails Last commit date
block 1 month ago plain 1 month ago admin-cancelled-order.php 1 year ago admin-failed-order.php 6 months ago admin-new-order.php 6 months ago admin-payment-gateway-enabled.php 2 months ago customer-cancelled-order.php 6 months ago customer-completed-order.php 6 months ago customer-failed-order.php 6 months ago customer-fulfillment-created.php 6 months ago customer-fulfillment-deleted.php 6 months ago customer-fulfillment-updated.php 1 month ago customer-invoice.php 6 months ago customer-new-account.php 6 months ago customer-note.php 6 months ago customer-on-hold-order.php 6 months ago customer-pos-completed-order.php 6 months ago customer-pos-refunded-order.php 6 months ago customer-processing-order.php 6 months ago customer-refunded-order.php 6 months ago customer-reset-password.php 6 months 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 3 months ago email-customer-details.php 1 year ago email-downloads.php 6 months ago email-footer.php 6 months ago email-fulfillment-details.php 2 months ago email-fulfillment-items.php 1 month ago email-header.php 2 months ago email-mobile-messaging.php 2 years ago email-order-details.php 1 month ago email-order-items.php 1 month ago email-styles.php 1 month ago
email-order-items.php
239 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://woocommerce.com/document/template-structure/
14 * @package WooCommerce\Templates\Emails
15 * @version 10.8.0
16 */
17
18 use Automattic\WooCommerce\Utilities\FeaturesUtil;
19
20 defined( 'ABSPATH' ) || exit;
21
22 $margin_side = is_rtl() ? 'left' : 'right';
23
24 $email_improvements_enabled = FeaturesUtil::feature_is_enabled( 'email_improvements' );
25 $price_text_align = $email_improvements_enabled ? 'right' : 'left';
26 $block_email_editor_enabled = FeaturesUtil::feature_is_enabled( 'block_email_editor' );
27
28 foreach ( $items as $item_id => $item ) :
29 $product = $item->get_product();
30 $sku = '';
31 $purchase_note = '';
32 $image = '';
33
34 if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
35 continue;
36 }
37
38 if ( is_object( $product ) ) {
39 $sku = $product->get_sku();
40 $purchase_note = $product->get_purchase_note();
41 $image = $product->get_image( $image_size );
42 }
43
44 ?>
45 <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>">
46 <td class="td font-family text-align-left" style="vertical-align: <?php echo $block_email_editor_enabled ? 'top' : 'middle'; ?>; word-wrap:break-word;">
47 <?php if ( $email_improvements_enabled ) { ?>
48 <table class="order-item-data" role="presentation">
49 <tr>
50 <?php
51 // Show title/image etc.
52 if ( $show_image ) {
53 /**
54 * Email Order Item Thumbnail hook.
55 *
56 * @param string $image The image HTML.
57 * @param WC_Order_Item_Product $item The item being displayed.
58 * @since 2.1.0
59 */
60 echo '<td style="vertical-align: top;">' . wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) ) . '</td>';
61 }
62 ?>
63 <td>
64 <?php
65 /**
66 * Order Item Name hook.
67 *
68 * @param string $item_name The item name HTML.
69 * @param WC_Order_Item_Product $item The item being displayed.
70 * @since 2.1.0
71 */
72 $order_item_name = apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false );
73 echo wp_kses_post( "<h3 style='font-size: inherit;font-weight: inherit;'>{$order_item_name}</h3>" );
74
75 // SKU.
76 if ( $show_sku && $sku ) {
77 echo wp_kses_post( ' (#' . $sku . ')' );
78 }
79
80 /**
81 * Allow other plugins to add additional product information.
82 *
83 * @param int $item_id The item ID.
84 * @param WC_Order_Item_Product $item The item object.
85 * @param WC_Order $order The order object.
86 * @param bool $plain_text Whether the email is plain text or not.
87 * @since 2.3.0
88 */
89 do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
90
91 $item_meta = wc_display_item_meta(
92 $item,
93 array(
94 'before' => '',
95 'after' => '',
96 'separator' => '<br>',
97 'echo' => false,
98 'label_before' => '<span>',
99 'label_after' => ':</span> ',
100 )
101 );
102 echo '<div class="email-order-item-meta">';
103 // Using wp_kses instead of wp_kses_post to remove all block elements.
104 echo wp_kses(
105 $item_meta,
106 array(
107 'br' => array(),
108 'span' => array(),
109 'a' => array(
110 'href' => true,
111 'target' => true,
112 'rel' => true,
113 'title' => true,
114 ),
115 )
116 );
117 echo '</div>';
118
119 /**
120 * Allow other plugins to add additional product information.
121 *
122 * @param int $item_id The item ID.
123 * @param WC_Order_Item_Product $item The item object.
124 * @param WC_Order $order The order object.
125 * @param bool $plain_text Whether the email is plain text or not.
126 * @since 2.3.0
127 */
128 do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
129
130 ?>
131 </td>
132 </tr>
133 </table>
134 <?php
135 } else {
136
137 // Show title/image etc.
138 if ( $show_image ) {
139 /**
140 * Email Order Item Thumbnail hook.
141 *
142 * @param string $image The image HTML.
143 * @param WC_Order_Item_Product $item The item being displayed.
144 * @since 2.1.0
145 */
146 echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) );
147 }
148
149 /**
150 * Order Item Name hook.
151 *
152 * @param string $item_name The item name HTML.
153 * @param WC_Order_Item_Product $item The item being displayed.
154 * @since 2.1.0
155 */
156 echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
157
158 // SKU.
159 if ( $show_sku && $sku ) {
160 echo wp_kses_post( ' (#' . $sku . ')' );
161 }
162
163 /**
164 * Allow other plugins to add additional product information.
165 *
166 * @param int $item_id The item ID.
167 * @param WC_Order_Item_Product $item The item object.
168 * @param WC_Order $order The order object.
169 * @param bool $plain_text Whether the email is plain text or not.
170 * @since 2.3.0
171 */
172 do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
173
174 wc_display_item_meta(
175 $item,
176 array(
177 'label_before' => '<strong class="wc-item-meta-label" style="float: ' . ( is_rtl() ? 'right' : 'left' ) . '; margin-' . esc_attr( $margin_side ) . ': .25em; clear: both">',
178 )
179 );
180
181 /**
182 * Allow other plugins to add additional product information.
183 *
184 * @param int $item_id The item ID.
185 * @param WC_Order_Item_Product $item The item object.
186 * @param WC_Order $order The order object.
187 * @param bool $plain_text Whether the email is plain text or not.
188 * @since 2.3.0
189 */
190 do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
191 }
192 ?>
193 </td>
194 <td class="td font-family text-align-<?php echo esc_attr( $price_text_align ); ?>" style="vertical-align:middle;">
195 <?php
196 $qty = $item->get_quantity();
197 $refunded_qty = $order->get_qty_refunded_for_item( $item_id );
198
199 if ( $refunded_qty ) {
200 $qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '</ins>';
201 } else {
202 $qty_display = esc_html( $qty );
203 }
204 /**
205 * Email Order Item Quantity hook.
206 *
207 * @since 2.4.0
208 * @param string $qty_display Item quantity.
209 * @param WC_Order_Item_Product $item Item object.
210 * @return string
211 */
212 $quantity = apply_filters( 'woocommerce_email_order_item_quantity', $qty_display, $item );
213 if ( '' !== $quantity ) {
214 $quantity_prefix = $email_improvements_enabled ? '&times;' : '';
215 echo wp_kses_post( $quantity_prefix . $quantity );
216 }
217 ?>
218 </td>
219 <td class="td font-family text-align-<?php echo esc_attr( $price_text_align ); ?>" style="vertical-align:middle;">
220 <?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?>
221 </td>
222 </tr>
223 <?php
224
225 if ( $show_purchase_note && $purchase_note ) {
226 ?>
227 <tr>
228 <td colspan="3" class="font-family text-align-left" style="vertical-align:middle;">
229 <?php
230 echo wp_kses_post( wpautop( do_shortcode( $purchase_note ) ) );
231 ?>
232 </td>
233 </tr>
234 <?php
235 }
236 ?>
237
238 <?php endforeach; ?>
239