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

106 lines 5.6 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->orderTaxRates->first();
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 = Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.name', '');
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 = Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.vat_number', '');
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 echo esc_html__('EU VAT', 'fluent-cart') . ': ' . esc_html($vatNumber); ?>
71 </p>
72 <?php
73 endif;
74 endif;
75 ?>
76 </td>
77 <td style="width:50%;padding-right: 0;padding-left: 10px;">
78 <?php if ($order->fulfillment_type !== 'digital'): ?>
79 <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">
80 <?php echo esc_html__('Shipping Address', 'fluent-cart'); ?>
81 </p>
82 <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">
83 <?php
84 if ($order->shipping_address) {
85 echo esc_html($order->shipping_address->getAddressAsText());
86 } else {
87 echo esc_html__('n/a', 'fluent-cart');
88 }
89 $phone = Arr::get($order->shipping_address->meta ?? [], 'other_data.phone', '');
90 if ($phone !== ''):
91 ?>
92 <p style="font-size:12px;margin:0px;margin-top:8px;line-height:24px;margin-top:0px;margin-left:0px;margin-right:0px">
93 <?php echo esc_html($phone); ?>
94 </p>
95 <?php endif; ?>
96 </p>
97 <?php endif; ?>
98 </td>
99 </tr>
100 </tbody>
101 </table>
102 </td>
103 </tr>
104 </tbody>
105 </table>
106