PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.6
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.6
1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 All 49 releases
fluent-cart / app / Views / emails / parts / addresses.php

addresses.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.6.6, at app/Views/emails/parts/addresses.php

128 lines 6.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2 <?php
3 /**
4 * @var $order \FluentCart\App\Models\Order
5 */
6 use FluentCart\Framework\Support\Arr;
7
8 $billingAddress = $order->billing_address;
9 $shippingAddress = $order->shipping_address;
10
11 if(!$billingAddress && !$shippingAddress) {
12 return;
13 }
14
15 ?>
16 <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation"
17 style="margin-bottom:24px">
18 <tbody style="vertical-align: top;">
19 <tr>
20 <td>
21 <table align="center" width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
22 <tbody style="width:100%; vertical-align: top;">
23 <tr style="width:100%">
24 <td style="width:50%;padding-left: 0;padding-right: 10px;">
25 <p style="font-size:12px;color:rgb(127,140,141);margin:0px;margin-bottom:8px;text-transform:uppercase;letter-spacing:1px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px">
26 <?php echo esc_html__('Billing Address', 'fluent-cart'); ?>
27 </p>
28 <p style="font-size:14px;color:rgb(44,62,80);margin:0px;line-height:1.4;margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px">
29 <?php
30 if ($order->billing_address) {
31 echo esc_html($order->billing_address->getAddressAsText());
32 } else {
33 echo esc_html__('n/a', 'fluent-cart');
34 }
35 ?>
36 </p>
37
38 <?php
39 $companyName = Arr::get($order->billing_address->meta ?? [], 'other_data.company_name', '');
40 $phone = Arr::get($order->billing_address->meta ?? [], 'other_data.phone', '');
41
42 if ($companyName == '') {
43 $companyName = $order->getCustomerTaxName();
44 }
45
46 // show phone number
47 if ($phone !== ''):
48 ?>
49 <p style="font-size:12px;margin:0px;margin-top:8px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px">
50 <?php echo esc_html($phone); ?>
51 </p>
52 <?php endif;
53
54 // show company name
55 if ($companyName !== '') {
56 ?>
57 <p style="font-size:12px;margin:0px;margin-top:8px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px">
58 <?php echo esc_html($companyName); ?>
59 </p>
60 <?php
61 }
62
63 // show order tax rates
64 $vatNumber = $order->getCustomerTaxNumber();
65 if ($vatNumber !== '') :
66 ?>
67 <p style="font-size:12px;margin:0px;margin-top:8px;text-transform:uppercase;letter-spacing:1px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px">
68 <?php
69 $vatLabel = __('VAT/Tax ID', 'fluent-cart');
70 echo esc_html($vatLabel) . ': ' . esc_html($vatNumber);
71 ?>
72 </p>
73 <?php
74 endif;
75
76 $legalRegId = Arr::get($order->billing_address->meta ?? [], 'other_data.legal_registration_id', '');
77 if ($legalRegId === '') {
78 $legalRegId = Arr::get($order->getBusinessInfo(), 'legal_registration_id', '');
79 }
80 if ($legalRegId !== ''):
81 ?>
82 <p style="font-size:12px;margin:0px;margin-top:8px;text-transform:uppercase;letter-spacing:1px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px">
83 <?php echo esc_html__('Reg. ID', 'fluent-cart') . ': ' . esc_html($legalRegId); ?>
84 </p>
85 <?php
86 endif;
87
88 $reverseChargeDeclaration = Arr::get($order->getBusinessInfo(), 'reverse_charge_declaration', '');
89 if ($reverseChargeDeclaration !== ''):
90 ?>
91 <p style="font-size:12px;margin:0px;margin-top:8px;line-height:24px;">
92 <strong><?php echo esc_html__('Reverse Charge Declaration', 'fluent-cart'); ?>:</strong>
93 <?php echo esc_html($reverseChargeDeclaration); ?>
94 </p>
95 <?php
96 endif;
97 ?>
98 </td>
99 <td style="width:50%;padding-right: 0;padding-left: 10px;">
100 <?php if ($order->fulfillment_type !== 'digital'): ?>
101 <p style="font-size:12px;color:rgb(127,140,141);margin:0px;margin-bottom:8px;text-transform:uppercase;letter-spacing:1px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px">
102 <?php echo esc_html__('Shipping Address', 'fluent-cart'); ?>
103 </p>
104 <p style="font-size:14px;color:rgb(44,62,80);margin:0px;line-height:1.4;margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px">
105 <?php
106 if ($order->shipping_address) {
107 echo esc_html($order->shipping_address->getAddressAsText());
108 } else {
109 echo esc_html__('n/a', 'fluent-cart');
110 }
111 $phone = Arr::get($order->shipping_address->meta ?? [], 'other_data.phone', '');
112 if ($phone !== ''):
113 ?>
114 <p style="font-size:12px;margin:0px;margin-top:8px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px">
115 <?php echo esc_html($phone); ?>
116 </p>
117 <?php endif; ?>
118 </p>
119 <?php endif; ?>
120 </td>
121 </tr>
122 </tbody>
123 </table>
124 </td>
125 </tr>
126 </tbody>
127 </table>
128