PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.5.3
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.5.3
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.5.3, at app/Views/emails/parts/addresses.php

132 lines 7.2 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 $orderTaxRates = $order->getPrimaryOrderTaxRate();
40 $companyName = Arr::get($order->billing_address->meta ?? [], 'other_data.company_name', '');
41 $phone = Arr::get($order->billing_address->meta ?? [], 'other_data.phone', '');
42
43 if ($companyName == '') {
44 $companyName = $order->getCustomerTaxName();
45 }
46
47 // show phone number
48 if ($phone !== ''):
49 ?>
50 <p style="font-size:12px;margin:0px;margin-top:8px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px">
51 <?php echo esc_html($phone); ?>
52 </p>
53 <?php endif;
54
55 // show company name
56 if ($companyName !== '') {
57 ?>
58 <p style="font-size:12px;margin:0px;margin-top:8px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px">
59 <?php echo esc_html($companyName); ?>
60 </p>
61 <?php
62 }
63
64 // show order tax rates
65 if ($orderTaxRates) :
66 $vatNumber = $order->getCustomerTaxNumber();
67 if ($vatNumber !== '') :
68 ?>
69 <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">
70 <?php
71 $vatLabel = __('VAT/Tax ID', 'fluent-cart');
72 echo esc_html($vatLabel) . ': ' . esc_html($vatNumber);
73 ?>
74 </p>
75 <?php
76 endif;
77
78 $legalRegId = Arr::get($order->billing_address->meta ?? [], 'other_data.legal_registration_id', '');
79 if ($legalRegId === '') {
80 $legalRegId = Arr::get($order->getBusinessInfo(), 'legal_registration_id', '');
81 }
82 if ($legalRegId !== ''):
83 ?>
84 <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">
85 <?php echo esc_html__('Reg. ID', 'fluent-cart') . ': ' . esc_html($legalRegId); ?>
86 </p>
87 <?php
88 endif;
89
90 $reverseChargeDeclaration = Arr::get($order->getBusinessInfo(), 'reverse_charge_declaration', '');
91 if ($reverseChargeDeclaration !== ''):
92 ?>
93 <p style="font-size:12px;margin:0px;margin-top:8px;line-height:24px;">
94 <strong><?php echo esc_html__('Reverse Charge Declaration', 'fluent-cart'); ?>:</strong>
95 <?php echo esc_html($reverseChargeDeclaration); ?>
96 </p>
97 <?php
98 endif;
99
100 endif;
101 ?>
102 </td>
103 <td style="width:50%;padding-right: 0;padding-left: 10px;">
104 <?php if ($order->fulfillment_type !== 'digital'): ?>
105 <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">
106 <?php echo esc_html__('Shipping Address', 'fluent-cart'); ?>
107 </p>
108 <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">
109 <?php
110 if ($order->shipping_address) {
111 echo esc_html($order->shipping_address->getAddressAsText());
112 } else {
113 echo esc_html__('n/a', 'fluent-cart');
114 }
115 $phone = Arr::get($order->shipping_address->meta ?? [], 'other_data.phone', '');
116 if ($phone !== ''):
117 ?>
118 <p style="font-size:12px;margin:0px;margin-top:8px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px">
119 <?php echo esc_html($phone); ?>
120 </p>
121 <?php endif; ?>
122 </p>
123 <?php endif; ?>
124 </td>
125 </tr>
126 </tbody>
127 </table>
128 </td>
129 </tr>
130 </tbody>
131 </table>
132