PluginProbe
YayMail – WooCommerce Email Customizer / 4.4.2
YayMail – WooCommerce Email Customizer v4.4.2
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 / templates / shortcodes / billing-shipping-address / main.php

main.php in YayMail – WooCommerce Email Customizer 4.4.2, at templates/shortcodes/billing-shipping-address/main.php

101 lines 4.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit;
4 }
5
6 use YayMail\Utils\TemplateHelpers;
7 use YayMail\Utils\Helpers;
8
9 if ( ! isset( $args['order'] ) || ! ( Helpers::is_woocommerce_order( $args['order'] ) ) ) {
10 return;
11 }
12
13 $order_instance = $args['order'];
14 $billing_address = $order_instance->get_formatted_billing_address();
15 $shipping_address = $order_instance->get_formatted_shipping_address();
16
17 if ( empty( $billing_address ) && empty( $shipping_address ) ) {
18 return;
19 } else {
20 if ( ! empty( $billing_address ) && ! empty( $shipping_address ) ) {
21 $width = '50%';
22 } else {
23 $width = '100%';
24 }
25 $table_style = TemplateHelpers::get_style(
26 [
27 'width' => '100%',
28 'text-align' => 'left',
29 'border-collapse' => 'separate',
30 'border-spacing' => '5px !important',
31 ]
32 );
33 $wrap_style = TemplateHelpers::get_style(
34 [
35 'border' => 'solid 1px ' . YAYMAIL_COLOR_BORDER_DEFAULT,
36 ]
37 );
38 $text_style = TemplateHelpers::get_style(
39 [
40 'font-family' => TemplateHelpers::get_font_family_value( YAYMAIL_DEFAULT_FAMILY ) . ' !important',
41 ]
42 );
43 ?>
44 <table style="<?php echo esc_attr( $table_style ); ?>">
45 <tbody>
46 <tr>
47 <?php
48 if ( ! empty( $billing_address ) ) :
49 $billing_phone = $order_instance->get_billing_phone();
50 $billing_email = $order_instance->get_billing_email();
51 ?>
52 <td style="width: <?php echo esc_attr( $width ); ?>; vertical-align: top;">
53 <h2 style="padding: 0; margin: 0 0 12px 0; font-size: 20px; color: <?php echo esc_attr( YAYMAIL_COLOR_WC_DEFAULT ); ?>"><?php esc_html_e( 'Billing Address', 'woocommerce' ); ?></h2>
54 <div style="<?php echo esc_attr( $wrap_style ); ?>">
55 <div style="padding: 12px; color: <?php echo esc_attr( YAYMAIL_COLOR_TEXT_DEFAULT ); ?>;">
56 <address style="<?php echo esc_attr( $text_style ); ?>">
57 <?php echo wp_kses_post( $billing_address ); ?>
58 <?php if ( ! empty( $billing_phone ) ) : ?>
59 <br/>
60 <a href='tel:<?php echo esc_attr( $billing_phone ); ?>' style="font-family: inherit;color:<?php echo esc_attr( $args['text_link_color'] ); ?>;">
61 <?php echo esc_html( $billing_phone ); ?>
62 </a>
63 <?php endif; ?>
64 <?php if ( ! empty( $billing_email ) ) : ?>
65 <br/>
66 <a href='mailto:<?php echo esc_attr( $billing_email ); ?>' style="font-family: inherit;color:<?php echo esc_attr( $args['text_link_color'] ); ?>;">
67 <?php echo esc_html( $billing_email ); ?>
68 </a>
69 <?php endif; ?>
70 </address>
71 </div>
72 </div>
73 </td>
74 <?php endif; ?>
75 <?php
76 if ( ! empty( $shipping_address ) ) :
77 $shipping_phone = $order_instance->get_shipping_phone();
78 ?>
79 <td style="width: <?php echo esc_attr( $width ); ?>; vertical-align: top;">
80 <h2 style="padding: 12px; font-size: 20px; color: <?php echo esc_attr( YAYMAIL_COLOR_WC_DEFAULT ); ?>"><?php esc_html_e( 'Shipping Address', 'woocommerce' ); ?></h2>
81 <div style="<?php echo esc_attr( $wrap_style ); ?>">
82 <div style="padding: 12px; color: <?php echo esc_attr( YAYMAIL_COLOR_TEXT_DEFAULT ); ?>;">
83 <address style="<?php echo esc_attr( $text_style ); ?>">
84 <?php echo wp_kses_post( $shipping_address ); ?>
85 <?php if ( ! empty( $shipping_phone ) ) : ?>
86 <br/>
87 <a href='tel:<?php echo esc_attr( $shipping_phone ); ?>' style="font-family: inherit; color:<?php echo esc_attr( $args['text_link_color'] ); ?>;">
88 <?php echo esc_html( $shipping_phone ); ?>
89 </a>
90 <?php endif; ?>
91 </address>
92 </div>
93 </div>
94 </td>
95 <?php endif; ?>
96 </tr>
97 </tbody>
98 </table>
99 <?php
100 }//end if
101