PluginProbe
YayMail – WooCommerce Email Customizer / 1.9.6
YayMail – WooCommerce Email Customizer v1.9.6
4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 All 57 releases
yaymail / views / templates / emails / email-order-items.php

email-order-items.php in YayMail – WooCommerce Email Customizer 1.9.6, at views/templates/emails/email-order-items.php

99 lines 5.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6 $text_align = is_rtl() ? 'right' : 'left';
7 $yaymail_settings = get_option( 'yaymail_settings' );
8 $orderImagePostions = isset( $yaymail_settings['image_position'] ) && ! empty( $yaymail_settings['image_position'] ) ? $yaymail_settings['image_position'] : 'Top';
9 $orderImage = isset( $yaymail_settings['product_image'] ) && '0' != $yaymail_settings['product_image'] ? $yaymail_settings['product_image'] : '0';
10
11 foreach ( $items as $item_id => $item ) :
12 if ( apply_filters( 'woocommerce_order_item_visible', true, $item ) ) {
13 $product = $item->get_product();
14 ?>
15 <tr class="<?php echo esc_attr( apply_filters( 'woocommerce_order_item_class', 'order_item', $item, $order ) ); ?>">
16 <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>;word-wrap:break-word;vertical-align: middle;padding: 12px;font-size: 14px;border-width: 1px;border-style: solid;<?php echo esc_attr( isset( $default_args['border_color'] ) ? $default_args['border_color'] : '' ); ?>">
17 <?php
18
19 if ( 'Bottom' == $orderImagePostions && '1' == $orderImage ) {
20 echo ( '<div class="yaymail-product-text" style="padding: 5px 0;">' );
21 // Product name
22 echo wp_kses_post( '<span class="yaymail-product-name" data-sku=' . $product->get_sku() . '>' . $item->get_name() . '</span>' );
23
24 // SKU
25 if ( $args['show_sku'] && is_object( $product ) && $product->get_sku() ) {
26 echo wp_kses_post( '<span class="yaymail-product-sku"> (#' . $product->get_sku() . ')</span>' );
27 }
28 // allow other plugins to add additional product information here
29 do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $args['plain_text'] );
30
31 // Display item meta data.
32 wc_display_item_meta( $item );
33
34 echo ( '</div>' );
35 // Show title/image etc
36 if ( $args['show_image'] && is_object( $product ) ) {
37 echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', '<div class="yaymail-product-image" style="margin-bottom: 5px"><img src="' . ( $product->get_image_id() ? current( wp_get_attachment_image_src( $product->get_image_id(), $args['image_size'][2] ) ) : wc_placeholder_img_src() ) . '" alt="' . esc_attr__( 'Product image', 'woocommerce' ) . '" height="' . esc_attr( str_replace( 'px', '', $args['image_size'][1] ) ) . '" width="' . esc_attr( str_replace( 'px', '', $args['image_size'][0] ) ) . '" style="vertical-align:middle; margin-' . ( is_rtl() ? 'left' : 'right' ) . ': 10px;" /></div>', $item ) );
38 }
39 } else {
40 // Show title/image etc
41 if ( $args['show_image'] && is_object( $product ) ) {
42 echo wp_kses_post( apply_filters( 'woocommerce_order_item_thumbnail', '<div class="yaymail-product-image" style="margin-bottom: 5px"><img src="' . ( $product->get_image_id() ? current( wp_get_attachment_image_src( $product->get_image_id(), $args['image_size'][2] ) ) : wc_placeholder_img_src() ) . '" alt="' . esc_attr__( 'Product image', 'woocommerce' ) . '" height="' . esc_attr( str_replace( 'px', '', $args['image_size'][1] ) ) . '" width="' . esc_attr( str_replace( 'px', '', $args['image_size'][0] ) ) . '" style="vertical-align:middle; margin-' . ( is_rtl() ? 'left' : 'right' ) . ': 10px;" /></div>', $item ) );
43 }
44 echo ( '<div style="padding: 5px 0;">' );
45 // Product name
46 echo wp_kses_post( '<span class="yaymail-product-name" data-sku=' . $product->get_sku() . '>' . $item->get_name() . '</span>' );
47
48 // SKU
49 if ( $args['show_sku'] && is_object( $product ) && $product->get_sku() ) {
50 echo wp_kses_post( '<span class="yaymail-product-sku"> (#' . $product->get_sku() . ')</span>' );
51 }
52 // allow other plugins to add additional product information here
53 do_action( 'woocommerce_order_item_meta_start', $item_id, $item, $order, $args['plain_text'] );
54
55 // Display item meta data.
56 wc_display_item_meta( $item );
57
58 echo ( '</div>' );
59 }
60
61
62 // Display item download links.
63 if ( $args['show_download_links'] ) {
64 wc_display_item_downloads( $item );
65 }
66
67 // allow other plugins to add additional product information here
68 do_action( 'woocommerce_order_item_meta_end', $item_id, $item, $order, $args['plain_text'] );
69 ?>
70
71 </td>
72 <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>; vertical-align:middle;padding: 12px;font-size: 14px;border-width: 1px;border-style: solid;<?php echo esc_attr( isset( $default_args['border_color'] ) ? $default_args['border_color'] : '' ); ?>">
73 <?php echo wp_kses_post( apply_filters( 'woocommerce_email_order_item_quantity', $item->get_quantity(), $item ) ); ?>
74 </td>
75 <td class="td" style="text-align:<?php echo esc_attr( $text_align ); ?>;vertical-align: middle;padding: 12px;font-size: 14px;border-width: 1px;border-style: solid;<?php echo esc_attr( isset( $default_args['border_color'] ) ? $default_args['border_color'] : '' ); ?>; word-break: break-all;">
76 <?php echo wp_kses_post( $order->get_formatted_line_subtotal( $item ) ); ?>
77 </td>
78 </tr>
79 <?php
80 }
81
82 // Show purchase note
83 $purchase_note = $product->get_purchase_note();
84 if ( isset( $args['show_purchase_note'] )
85 && is_object( $product )
86 && ! empty( $purchase_note )
87 ) {
88 ?>
89
90 <tr>
91 <td colspan="3" style="text-align:<?php echo esc_attr( $text_align ); ?>;vertical-align: middle;padding: 12px;font-size: 14px;border-width: 1px;border-style: solid;<?php echo esc_attr( isset( $default_args['border_color'] ) ? $default_args['border_color'] : '' ); ?>">
92 <?php echo esc_html( wpautop( do_shortcode( wp_kses_post( $purchase_note ) ) ) ); ?>
93 </td>
94 </tr>
95
96 <?php } ?>
97
98 <?php endforeach; ?>
99