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

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

218 lines 7.8 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\Page\Source\CustomPostType;
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 $postID = CustomPostType::postIDByTemplate( $this->template );
11 $text_link_color = get_post_meta( $postID, '_yaymail_email_textLinkColor_settings', true ) ? get_post_meta( $postID, '_yaymail_email_textLinkColor_settings', true ) : '#96588a';
12
13 // instructions payment
14 $paymentGateways = wc_get_payment_gateway_by_order( $order );
15 $yaymail_settings = get_option( 'yaymail_settings' );
16
17 if ( ( 'customer_on_hold_order' === $this->template
18 || 'customer_processing_order' === $this->template
19 || 'customer_completed_order' === $this->template
20 || 'customer_refunded_order' === $this->template
21 || 'customer_invoice' === $this->template
22 || 'customer_note' === $this->template )
23 && 2 == $yaymail_settings['payment']
24 || ( isset( $paymentGateways->method_title ) ? 'Cash on delivery' == $paymentGateways->method_title : false
25 && 'cancelled_order' != $this->template
26 && 'new_order' != $this->template
27 && 'failed_order' != $this->template
28 && 'customer_new_account' != $this->template
29 && 'customer_reset_password' != $this->template )
30 ) {?>
31
32 <p style="text-align: ' . $text_align . '; margin: 0 0 16px;" class="yaymail_builder_instructions">
33 <?php esc_html_e( isset( $paymentGateways->instructions ) ? $paymentGateways->instructions : '', 'woocommerce' ); ?>
34 </p>
35
36 <?php } elseif ( 1 == $yaymail_settings['payment'] ) { ?>
37
38 <p style="margin: 0 0 16px;" class="yaymail_builder_instructions">
39 <?php esc_html_e( isset( $paymentGateways->instructions ) ? $paymentGateways->instructions : '', 'woocommerce' ); ?>
40 </p>
41
42 <?php
43 }
44
45 /*
46 Our bank details
47 payment: Direct bank transfer
48 */
49 if ( false != $paymentGateways && isset( $paymentGateways->account_details ) ) {
50 $account_details = $paymentGateways->account_details;
51 $texts = array(
52 'bank_name' => 'Bank',
53 'account_number' => 'Account number',
54 'sort_code' => 'Sort Code',
55 'iban' => 'IBAN',
56 'bic' => 'BIC',
57 );
58
59 if ( ( 'customer_on_hold_order' === $this->template
60 || 'customer_processing_order' === $this->template
61 || 'customer_completed_order' === $this->template
62 || 'customer_refunded_order' === $this->template
63 || 'customer_invoice' === $this->template
64 || 'customer_note' === $this->template )
65 && 'Direct bank transfer' == $paymentGateways->method_title
66 && is_array( $account_details )
67 && count( $account_details ) > 0
68 ) {
69 ?>
70
71 <section style="text-align: ' . $text_align . '" class="yaymail_builder_wrap_account">
72 <h2 class="yaymail_builder_bank_details" style="color: #96588a;">
73 <?php esc_html_e( 'Our bank details', 'woocommerce' ); ?>
74 </h2>
75
76 <?php
77 foreach ( $account_details as $accounts ) {
78 foreach ( $accounts as $label_name => $infor_account ) {
79 if ( 'account_name' === $label_name && ! empty( $infor_account ) ) {
80 ?>
81 <h3 class="yaymail_builder_account_name" style="color: #96588a;">
82 <?php
83 esc_html_e( $infor_account, 'woocommerce' );
84 ?>
85 </h3>
86 <?php
87 }
88 }
89 ?>
90
91 <ul>
92 <?php
93 foreach ( $accounts as $label_name => $infor_account ) {
94 if ( 'account_name' !== $label_name && ! empty( $infor_account ) ) {
95 ?>
96
97 <li><?php esc_html_e( $texts[ $label_name ], 'woocommerce' ); ?>:
98 <strong><?php esc_html_e( $infor_account, 'woocommerce' ); ?></strong>
99 </li>
100
101 <?php
102 }
103 }
104 ?>
105 </ul>
106
107 <?php } ?>
108
109 </section>
110 <?php
111 }
112 }
113 ?>
114
115 <!-- Title Table Order Items -->
116 <h2 class="yaymail_builder_order" style="color: #96588a;font-size: 18px;font-weight: 700;">
117 <?php
118 if ( $sent_to_admin ) {
119 $before = '<a style="font-weight: normal;color: ' . $text_link_color . '" class="yaymail_builder_link" href="' . esc_url( $order->get_edit_order_url() ) . '">';
120 $after = '</a>';
121 /* translators: %s: Order ID. */
122 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() ) ) );
123 } else {
124 $before = '';
125 $after = '';
126 /* translators: %s: Order ID. */
127 echo wp_kses_post( $before . sprintf( __( 'Order #%s', 'woocommerce' ), $order->get_order_number() ) );
128 }
129 ?>
130 </h2>
131
132 <!-- Table Items has Border -->
133 <table class="yaymail_builder_table_items_content" cellspacing="0" cellpadding="6" border="1" style="width: 100% !important;color: inherit;flex-direction:column;border: 1px solid;border-color: inherit;" width="100%">
134 <thead>
135 <tr style="word-break: normal">
136 <th class="td" scope="col" style="text-align:left;vertical-align: middle;padding: 12px;font-size: 14px;border: 1px solid;border-color: inherit;">
137 <?php esc_html_e( 'Product', 'woocommerce' ); ?>
138 </th>
139 <th class="td" scope="col" style="text-align:left;vertical-align: middle;padding: 12px;font-size: 14px;border: 1px solid;border-color: inherit;">
140 <?php esc_html_e( 'Quantity', 'woocommerce' ); ?>
141 </th>
142 <th class="td" scope="col" style="text-align:left; width: 30%;vertical-align: middle;padding: 12px;font-size: 14px;border: 1px solid;border-color: inherit;">
143 <?php esc_html_e( 'Price', 'woocommerce' ); ?>
144 </th>
145 </tr>
146 </thead>
147
148 <tbody style="flex-direction:inherit;" >
149 <?php
150 echo wp_kses_post(
151 $this->ordetItemTables(
152 $order,
153 array(
154 'show_sku' => $sent_to_admin,
155 'show_image' => false,
156 'image_size' => array( 32, 32 ),
157 'plain_text' => $plain_text,
158 'sent_to_admin' => $sent_to_admin,
159 )
160 )
161 );
162
163 // customer processing order
164 $items = $order->get_items();
165 foreach ( $items as $item ) {
166 $product = $item->get_product();
167 $purchase_note = $product->get_purchase_note();
168 }
169
170 if ( 'customer_processing_order' === $this->template && ! empty( $purchase_note ) ) {
171 ?>
172
173 <tr>
174 <td class="td" scope="row" colspan="3" style="text-align:left;vertical-align: middle;padding: 12px;font-size: 14px;border: 1px solid;border-color: inherit;">
175 <?php esc_html_e( $purchase_note, 'woocommerce' ); ?>
176 </td>
177 </tr>
178
179 <?php } ?>
180 </tbody>
181
182 <tfoot>
183 <?php
184 $totalItem = $order->get_order_item_totals();
185 $i = 0;
186 foreach ( $totalItem as $key => $total ) {
187 $i++;
188 ?>
189
190 <tr>
191 <th class="td" scope="row" colspan="2" style="text-align:left;vertical-align: middle;padding: 12px;font-size: 14px;border: 1px solid;border-color: inherit; <?php echo esc_attr( ( 1 === $i ) ? 'border-top-width: 4px;' : '' ); ?>">
192 <?php echo esc_html( $total['label'] ); ?>
193 </th>
194 <td class="td" style="text-align:left;vertical-align: middle;padding: 12px;font-size: 14px;border: 1px solid;border-color: inherit; <?php echo esc_attr( ( 1 === $i ) ? 'border-top-width: 4px;' : '' ); ?>">
195 <?php echo wp_kses_post( $total['value'] ); ?>
196 </td>
197 </tr>
198
199 <?php
200 }
201
202 if ( ! empty( $order->get_customer_note() ) ) {
203 $note = $order->get_customer_note();
204 ?>
205
206 <tr>
207 <th class="td" scope="row" colspan="2" style="text-align:left;vertical-align: middle;padding: 12px;font-size: 14px;border: 1px solid;border-color: inherit; <?php echo esc_attr( ( 1 === $i ) ? 'border-top-width: 4px;' : '' ); ?>">
208 <?php esc_html_e( 'Note:', 'woocommerce' ); ?>
209 </th>
210 <td class="td" style="text-align:left;vertical-align: middle;padding: 12px;font-size: 14px;border: 1px solid;border-color: inherit; <?php echo esc_attr( ( 1 === $i ) ? 'border-top-width: 4px;' : '' ); ?>">
211 <?php echo esc_html( $note ); ?>
212 </td>
213 </tr>
214
215 <?php } ?>
216 </tfoot>
217 </table>
218