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-details.php

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

197 lines 6.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 defined( 'ABSPATH' ) || exit;
4 use YayMail\Helper\Helper;
5
6 $sent_to_admin = ( isset( $sent_to_admin ) ? true : false );
7 $email = ( isset( $email ) ? $email : '' );
8 $plain_text = ( isset( $plain_text ) ? $plain_text : '' );
9 $text_align = is_rtl() ? 'right' : 'left';
10 // Instructions Payment
11 $paymentGateways = wc_get_payment_gateway_by_order( $order );
12 $yaymail_settings = get_option( 'yaymail_settings' );
13
14 if ( 'customer_on_hold_order' === $this->template
15 && 2 == $yaymail_settings['payment']
16 || ( 'Cash on delivery' == Helper::checkKeyExist( $paymentGateways, 'method_title', false )
17 && 'cancelled_order' != $this->template
18 && 'new_order' != $this->template
19 && 'failed_order' != $this->template
20 && 'customer_refunded_order' != $this->template
21 && 'customer_new_account' != $this->template
22 && 'customer_reset_password' != $this->template )
23 ) {?>
24
25 <p class="yaymail_builder_instructions"><?php esc_html_e( isset( $paymentGateways->instructions ) ? $paymentGateways->instructions : '', 'woocommerce' ); ?></p>
26
27 <?php
28 } elseif ( 1 == $yaymail_settings['payment'] ) {
29 ?>
30
31 <p class="yaymail_builder_instructions"><?php esc_html_e( isset( $paymentGateways->instructions ) ? $paymentGateways->instructions : '', 'woocommerce' ); ?></p>
32
33 <?php
34 }
35
36 /*
37 Our bank details
38 payment: Direct bank transfer
39 */
40 if ( false != $paymentGateways && isset( $paymentGateways->account_details ) ) {
41 $account_details = $paymentGateways->account_details;
42 $texts = array(
43 'bank_name' => 'Bank',
44 'account_number' => 'Account number',
45 'sort_code' => 'Sort Code',
46 'iban' => 'IBAN',
47 'bic' => 'BIC',
48 );
49
50 if ( 'customer_on_hold_order' === $this->template
51 && 'Direct bank transfer' == Helper::checkKeyExist( $paymentGateways, 'method_title', false )
52 && is_array( $account_details )
53 && count( $account_details ) > 0
54 ) {
55 ?>
56
57 <section class="yaymail_builder_wrap_account">
58 <h2 class="yaymail_builder_bank_details"><?php esc_html_e( 'Our bank details', 'woocommerce' ); ?></h2>
59 <?php
60 foreach ( $account_details as $accounts ) {
61 foreach ( $accounts as $label_name => $infor_account ) {
62 if ( 'account_name' === $label_name && ! empty( $infor_account ) ) {
63 ?>
64 <h3 class="yaymail_builder_account_name"> <?php esc_html_e( $infor_account, 'woocommerce' ); ?> </h3>
65 <?php
66 }
67 }
68 ?>
69
70 <ul>
71 <?php
72 foreach ( $accounts as $label_name => $infor_account ) {
73 if ( 'account_name' !== $label_name && ! empty( $infor_account ) ) {
74 ?>
75 <li><?php esc_html_e( $texts[ $label_name ], 'woocommerce' ); ?>:
76 <strong><?php esc_html_e( $infor_account, 'woocommerce' ); ?></strong>
77 </li>
78 <?php
79 }
80 }
81 ?>
82 </ul>
83
84 <?php } ?>
85 </section>
86 <?php
87 }
88 }
89 ?>
90
91 <!-- Title Table Order -->
92 <h2 class="yaymail_builder_order">
93 <?php
94 if ( $sent_to_admin ) {
95 $before = '<a class="yaymail_builder_link" href="' . esc_url( $order->get_edit_order_url() ) . '">';
96 $after = '</a>';
97 /* translators: %s: Order ID. */
98 echo wp_kses_post( $before . sprintf( __( '[Order #%s]', 'woocommerce' ) . $after . ' (<time datetime="%s">%s</time>)', $order->get_order_number(), $order->get_date_created()->format( 'c' ), wc_format_datetime( $order->get_date_created() ) ) );
99 } else {
100 $before = '';
101 $after = '';
102 /* translators: %s: Order ID. */
103 echo wp_kses_post( $before . sprintf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ) );
104 }
105
106 ?>
107 </h2>
108
109 <!-- Table Items not border -->
110 <table class="yaymail_builder_table_items" cellspacing="0" cellpadding="6" style="width: 100% !important;" width="100%">
111 <thead>
112 <tr style="word-break: normal">
113 <th class="td" scope="col" style="text-align:left;">
114 <?php esc_html_e( 'Product', 'woocommerce' ); ?>
115 </th>
116 <th class="td" scope="col" style="text-align:left;">
117 <?php esc_html_e( 'Quantity', 'woocommerce' ); ?>
118 </th>
119 <th class="td" scope="col" style="text-align:left; width: 30%;">
120 <?php esc_html_e( 'Price', 'woocommerce' ); ?>
121 </th>
122 </tr>
123 </thead>
124
125 <tbody>
126 <?php
127 echo wp_kses_post(
128 $this->ordetItemTables(
129 $order,
130 array(
131 'show_sku' => $sent_to_admin,
132 'show_image' => false,
133 'image_size' => array( 32, 32 ),
134 'plain_text' => $plain_text,
135 'sent_to_admin' => $sent_to_admin,
136 )
137 )
138 );
139
140 // customer_processing_order
141 $items = $order->get_items();
142 foreach ( $items as $item ) {
143 $product = $item->get_product();
144 $purchase_note = $product->get_purchase_note();
145 }
146 if ( 'customer_processing_order' === $this->template && ! empty( $purchase_note ) ) {
147 ?>
148
149 <tr>
150 <td class="td" scope="row" colspan="3" style="text-align:left;">
151 <?php esc_html_e( $purchase_note, 'woocommerce' ); ?>
152 </td>
153 </tr>
154
155 <?php } ?>
156 </tbody>
157
158 <tfoot>
159 <?php
160 $totalItem = $order->get_order_item_totals();
161 $i = 0;
162 foreach ( $totalItem as $key => $total ) {
163 $i++;
164 ?>
165
166 <tr>
167 <th class="td" scope="row" colspan="2" style="text-align:left; <?php echo esc_attr( ( 1 === $i ) ? 'border-top-width: 4px;' : '' ); ?>">
168 <?php echo esc_html( $total['label'] ); ?>
169 </th>
170 <td class="td" style="text-align:left; <?php echo esc_attr( ( 1 === $i ) ? 'border-top-width: 4px;' : '' ); ?>">
171 <?php echo wp_kses_post( $total['value'] ); ?>
172 </td>
173 </tr>
174
175 <?php
176 }
177
178
179 if ( ! empty( $order->get_customer_note() ) ) {
180 $note = $order->get_customer_note();
181 ?>
182
183 <tr>
184 <th class="td" scope="row" colspan="2" style="text-align:left; <?php echo esc_attr( ( 1 === $i ) ? 'border-top-width: 4px;' : '' ); ?>">
185 <?php esc_html_e( 'Note:', 'woocommerce' ); ?>
186 </th>
187 <td class="td" style="text-align:left; <?php echo esc_attr( ( 1 === $i ) ? 'border-top-width: 4px;' : '' ); ?>">
188 <?php echo esc_html( $note ); ?>
189 </td>
190 </tr>
191
192 <?php } ?>
193 </tfoot>
194 </table>
195
196 <?php do_action( 'woocommerce_email_after_order_table', $order, $sent_to_admin, $plain_text, $email ); ?>
197