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2.0-rc.1 3.0.9 6.2.0-rc.2 3.1.0 6.2.1 3.1.1 6.2.2 3.1.2 6.2.3 3.2.0 6.3.0 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 3 days ago plain 3 days ago admin-cancelled-order.php 1 year ago admin-failed-order.php 7 months ago admin-new-order.php 7 months ago admin-payment-gateway-enabled.php 3 months ago customer-abandoned-cart-recovery.php 3 days ago customer-cancelled-order.php 7 months ago customer-completed-order.php 7 months ago customer-failed-order.php 7 months ago customer-fulfillment-created.php 7 months ago customer-fulfillment-deleted.php 7 months ago customer-fulfillment-updated.php 2 months ago customer-invoice.php 7 months ago customer-new-account.php 1 month ago customer-note.php 7 months ago customer-on-hold-order.php 7 months ago customer-pos-completed-order.php 7 months ago customer-pos-refunded-order.php 7 months ago customer-processing-order.php 7 months ago customer-refunded-order.php 7 months ago customer-reset-password.php 1 month ago customer-review-request.php 2 months ago customer-stock-notification-verified.php 1 month ago customer-stock-notification-verify.php 10 months ago customer-stock-notification.php 10 months ago customer-verify-email.php 3 days ago email-addresses.php 4 months ago email-button.php 3 days ago email-customer-details.php 1 year ago email-downloads.php 7 months ago email-footer.php 7 months ago email-fulfillment-details.php 3 months ago email-fulfillment-items.php 3 days ago email-header.php 3 months ago email-mobile-messaging.php 2 years ago email-order-details.php 2 months ago email-order-items.php 3 days ago email-styles.php 3 days ago
email-order-items.php
259 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 11.0.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 /**
35 * Email Order Item Visibility hook.
36 *
37 * @param bool $visible Whether the order item is visible.
38 * @param WC_Order_Item_Product $item The item being displayed.
39 * @since 2.1.0
40 */
41 if ( ! apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
42 continue;
43 }
44
45 if ( is_object( $product ) ) {
46 $sku = $product->get_sku();
47 $purchase_note = $product->get_purchase_note();
48 $image = $product->get_image( $image_size );
49 }
50
51 /**
52 * Email Order Item Class hook.
53 *
54 * @param string $class The order item row class.
55 * @param WC_Order_Item_Product $item The item being displayed.
56 * @param WC_Order $order The order object.
57 * @since 2.1.0
58 */
59 $order_item_class = apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order );
60 ?>
61 <tr class="<?php echo esc_attr( $order_item_class ); ?>">
62 <td class="td font-family text-align-left" style="vertical-align: <?php echo $block_email_editor_enabled ? 'top' : 'middle'; ?>; word-wrap:break-word;">
63 <?php if ( $email_improvements_enabled ) { ?>
64 <table class="order-item-data" role="presentation">
65 <tr>
66 <?php
67 // Show title/image etc.
68 if ( $show_image ) {
69 $image_dimensions = wc_get_image_size( $image_size );
70 $image_width = is_array( $image_dimensions ) && isset( $image_dimensions['width'] ) ? absint( $image_dimensions['width'] ) : 48;
71 $thumbnail_width = $image_width + 24;
72
73 /**
74 * Email Order Item Thumbnail hook.
75 *
76 * @param string $image The image HTML.
77 * @param WC_Order_Item_Product $item The item being displayed.
78 * @since 2.1.0
79 */
80 echo '<td class="email-order-item-thumbnail" style="width: ' . esc_attr( $thumbnail_width ) . 'px;">' . wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) ) . '</td>';
81 }
82 ?>
83 <td>
84 <?php
85 /**
86 * Order Item Name hook.
87 *
88 * @param string $item_name The item name HTML.
89 * @param WC_Order_Item_Product $item The item being displayed.
90 * @since 2.1.0
91 */
92 $order_item_name = apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false );
93 echo wp_kses_post( "<h3 style='font-size: inherit;font-weight: inherit;'>{$order_item_name}</h3>" );
94
95 // SKU.
96 if ( $show_sku && $sku ) {
97 echo wp_kses_post( ' (#' . $sku . ')' );
98 }
99
100 /**
101 * Allow other plugins to add additional product information.
102 *
103 * @param int $item_id The item ID.
104 * @param WC_Order_Item_Product $item The item object.
105 * @param WC_Order $order The order object.
106 * @param bool $plain_text Whether the email is plain text or not.
107 * @since 2.3.0
108 */
109 do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
110
111 $item_meta = wc_display_item_meta(
112 $item,
113 array(
114 'before' => '',
115 'after' => '',
116 'separator' => '<br>',
117 'echo' => false,
118 'label_before' => '<span>',
119 'label_after' => ':</span> ',
120 )
121 );
122 echo '<div class="email-order-item-meta">';
123 // Using wp_kses instead of wp_kses_post to remove all block elements.
124 echo wp_kses(
125 $item_meta,
126 array(
127 'br' => array(),
128 'span' => array(),
129 'a' => array(
130 'href' => true,
131 'target' => true,
132 'rel' => true,
133 'title' => true,
134 ),
135 )
136 );
137 echo '</div>';
138
139 /**
140 * Allow other plugins to add additional product information.
141 *
142 * @param int $item_id The item ID.
143 * @param WC_Order_Item_Product $item The item object.
144 * @param WC_Order $order The order object.
145 * @param bool $plain_text Whether the email is plain text or not.
146 * @since 2.3.0
147 */
148 do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
149
150 ?>
151 </td>
152 </tr>
153 </table>
154 <?php
155 } else {
156
157 // Show title/image etc.
158 if ( $show_image ) {
159 /**
160 * Email Order Item Thumbnail hook.
161 *
162 * @param string $image The image HTML.
163 * @param WC_Order_Item_Product $item The item being displayed.
164 * @since 2.1.0
165 */
166 echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', $image, $item ) );
167 }
168
169 /**
170 * Order Item Name hook.
171 *
172 * @param string $item_name The item name HTML.
173 * @param WC_Order_Item_Product $item The item being displayed.
174 * @since 2.1.0
175 */
176 echo wp_kses_post( apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ) );
177
178 // SKU.
179 if ( $show_sku && $sku ) {
180 echo wp_kses_post( ' (#' . $sku . ')' );
181 }
182
183 /**
184 * Allow other plugins to add additional product information.
185 *
186 * @param int $item_id The item ID.
187 * @param WC_Order_Item_Product $item The item object.
188 * @param WC_Order $order The order object.
189 * @param bool $plain_text Whether the email is plain text or not.
190 * @since 2.3.0
191 */
192 do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $plain_text );
193
194 wc_display_item_meta(
195 $item,
196 array(
197 'label_before' => '<strong class="wc-item-meta-label" style="float: ' . ( is_rtl() ? 'right' : 'left' ) . '; margin-' . esc_attr( $margin_side ) . ': .25em; clear: both">',
198 )
199 );
200
201 /**
202 * Allow other plugins to add additional product information.
203 *
204 * @param int $item_id The item ID.
205 * @param WC_Order_Item_Product $item The item object.
206 * @param WC_Order $order The order object.
207 * @param bool $plain_text Whether the email is plain text or not.
208 * @since 2.3.0
209 */
210 do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $plain_text );
211 }
212 ?>
213 </td>
214 <td class="td font-family text-align-<?php echo esc_attr( $price_text_align ); ?>" style="vertical-align:middle;">
215 <?php
216 $qty = $item->get_quantity();
217 $refunded_qty = $order->get_qty_refunded_for_item( $item_id );
218
219 if ( $refunded_qty ) {
220 $qty_display = '<del>' . esc_html( $qty ) . '</del> <ins>' . esc_html( $qty - ( $refunded_qty * -1 ) ) . '</ins>';
221 } else {
222 $qty_display = esc_html( $qty );
223 }
224 /**
225 * Email Order Item Quantity hook.
226 *
227 * @since 2.4.0
228 * @param string $qty_display Item quantity.
229 * @param WC_Order_Item_Product $item Item object.
230 * @return string
231 */
232 $quantity = apply_filters( 'woocommerce_email_order_item_quantity', $qty_display, $item );
233 if ( '' !== $quantity ) {
234 $quantity_prefix = $email_improvements_enabled ? '&times;' : '';
235 echo wp_kses_post( $quantity_prefix . $quantity );
236 }
237 ?>
238 </td>
239 <td class="td font-family text-align-<?php echo esc_attr( $price_text_align ); ?>" style="vertical-align:middle;">
240 <?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?>
241 </td>
242 </tr>
243 <?php
244
245 if ( $show_purchase_note && $purchase_note ) {
246 ?>
247 <tr>
248 <td colspan="3" class="font-family text-align-left" style="vertical-align:middle;">
249 <?php
250 echo wp_kses_post( wpautop( do_shortcode( $purchase_note ) ) );
251 ?>
252 </td>
253 </tr>
254 <?php
255 }
256 ?>
257
258 <?php endforeach; ?>
259