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 / items_table.php

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

259 lines 12.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 \FluentCart\App\Models\Order $order
5 * @var $cart_image
6 * @var $item_count
7 */
8 ?>
9 <?php if (isset($heading)): ?>
10 <p style="font-size:16px;font-weight:500;color:rgb(44,62,80);line-height:24px;margin: 0 0 16px;">
11 <?php echo esc_html($heading); ?>
12 </p>
13 <?php endif; ?>
14
15 <?php
16
17 use FluentCart\Framework\Support\Arr;
18 $allOrderItems = $order->order_items ? $order->order_items->toArray() : [];
19 $orderItems = array_filter($allOrderItems, function ($item) {
20 return !in_array($item['payment_type'] ?? '', ['signup_fee', 'fee']);
21 });
22 $feeItems = array_filter($allOrderItems, function ($item) {
23 return ($item['payment_type'] ?? '') === 'fee';
24 });
25 $transaction = $order->getLatestTransaction();
26 $isRefund = $is_refund ?? false;
27
28 ?>
29
30 <table role="presentation" style="border-spacing:0;padding: 0; width: 100%;border: none">
31 <thead>
32 <tr>
33 <th style="background-color:rgb(249,250,251); padding-left: 16px">
34 <p style="font-size:12px;font-weight:600;color:rgb(55,65,81);text-transform:uppercase;line-height:24px;margin: 0;text-align: left">
35 <?php echo esc_html__('Item', 'fluent-cart'); ?>
36 </p>
37 </th>
38
39 <th style="background-color:rgb(249,250,251); width: 50px"></th>
40
41 <th style="background-color:rgb(249,250,251); padding-right: 16px; width: 200px;">
42 <p style="font-size:12px;font-weight:600;color:rgb(55,65,81);text-transform:uppercase;line-height:24px;margin: 0;text-align: right">
43 <?php echo esc_html__('Total', 'fluent-cart'); ?>
44 </p>
45 </th>
46 </tr>
47 </thead>
48 <tbody style="width:100%">
49 <?php foreach ($orderItems as $item): ?>
50 <tr>
51 <td style="padding-left: 16px;padding-top: 8px;padding-bottom: 8px;" colspan="2">
52 <p style="font-size: 15px; color: #2F3448; font-weight: 500; overflow: hidden; line-height: 18px; margin-top: 0; margin-bottom: 5px;">
53
54 <?php echo esc_html($item['post_title']); ?>
55 <?php if ($item['quantity'] > 1): ?>
56 <span style="font-size:12px;font-weight:400;color:rgb(75,85,99)">x <?php echo esc_html($item['quantity']); ?></span>
57 <?php endif; ?>
58
59 <p style="margin: 0; font-size: 14px; color: #758195; font-weight: 400; line-height: 15px;">
60 - <?php echo esc_html($item['title']); ?>
61 </p>
62
63 <?php if ($item['payment_type'] === 'subscription' && !empty($item['payment_info'])): ?>
64 <p style="font-size:12px;color:rgb(75,85,99);line-height:20px;margin: 3px 0 0 0;">
65 <?php echo wp_kses_post($item['payment_info']) ?>
66 </p>
67 <?php endif; ?>
68
69 <?php
70 $otherInfo = is_array($item['other_info'] ?? null) ? $item['other_info'] : [];
71 $packageInfo = Arr::get($item, 'package_info', '');
72 if (!$packageInfo && Arr::get($otherInfo, 'package_name')) {
73 $packageInfo = \FluentCart\App\Services\Renderer\ProductCardRender::buildPackageInfoFromOtherInfo($otherInfo);
74 }
75 if ($packageInfo):
76 ?>
77 <p style="font-size:12px;color:rgb(107,114,128);line-height:18px;margin: 5px 0 0 0;">
78 <?php echo esc_html($packageInfo); ?>
79 </p>
80 <?php endif; ?>
81 </p>
82 </td>
83 <td style="padding-right: 16px;text-align:right">
84 <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0;line-height:24px;">
85 <?php echo esc_html($item['formatted_total']); ?>
86 </p>
87 </td>
88 </tr>
89 <?php endforeach; ?>
90 </tbody>
91 </table>
92 <table style="border-spacing:0;padding: 0; width: 100%;border: none;">
93 <tr>
94 <td style="width: 50%;"></td>
95 <td style="width: 100%;">
96 <table role="presentation"
97 style="background-color:rgb(249,250,251);padding:16px;border-radius:8px;margin: 0; width: 100%;border: none;">
98 <tbody>
99 <?php if ($order->subtotal != $order->total_amount): ?>
100 <tr style="width:100%">
101 <td style="width:70%">
102 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
103 <?php echo esc_html__('Subtotal', 'fluent-cart'); ?>
104 </p>
105 </td>
106 <td style="width:30%;text-align:right">
107 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
108 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->subtotal)); ?>
109 </p>
110 </td>
111 </tr>
112 <?php endif; ?>
113
114 <?php if ($order->shipping_total > 0): ?>
115 <tr style="width:100%">
116 <td style="width:70%">
117 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
118 <?php echo esc_html__('Shipping', 'fluent-cart'); ?>
119 </p>
120 </td>
121 <td style="width:30%;text-align:right">
122 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
123 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->shipping_total)); ?>
124 </p>
125 </td>
126 </tr>
127 <?php endif; ?>
128 <?php if ($order->shipping_tax > 0): ?>
129 <tr style="width:100%">
130 <td style="width:70%">
131 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
132 <?php echo esc_html__('Shipping Tax', 'fluent-cart'); ?>
133 <?php echo esc_html($order->tax_behavior == 2 ? __('(Included)', 'fluent-cart') : __('(Excluded)', 'fluent-cart')); ?>
134 </p>
135 </td>
136 <td style="width:30%;text-align:right">
137 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
138 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->shipping_tax)); ?>
139 </p>
140 </td>
141 </tr>
142 <?php endif; ?>
143 <?php foreach ($feeItems as $feeItem): ?>
144 <tr style="width:100%">
145 <td style="width:70%">
146 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
147 <?php echo esc_html($feeItem['title']); ?>
148 </p>
149 </td>
150 <td style="width:30%;text-align:right">
151 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
152 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($feeItem['subtotal'])); ?>
153 </p>
154 </td>
155 </tr>
156 <?php endforeach; ?>
157 <?php if ($order->manual_discount_total + $order->coupon_discount_total > 0): ?>
158 <tr style="width:100%">
159 <td style="width:70%">
160 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
161 <?php echo esc_html__('Discount', 'fluent-cart'); ?>
162 </p>
163 </td>
164 <td style="width:30%;text-align:right">
165 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
166 - <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->manual_discount_total + $order->coupon_discount_total)); ?>
167 </p>
168 </td>
169 </tr>
170 <?php endif; ?>
171 <?php if ($order->tax_total > 0): ?>
172 <tr style="width:100%">
173 <td style="width:70%">
174 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
175 <?php echo esc_html__('Tax', 'fluent-cart'); ?>
176 <?php echo esc_html($order->tax_behavior == 2 ? __('(Included)', 'fluent-cart') : __('(Excluded)', 'fluent-cart')); ?>
177 </p>
178 </td>
179 <td style="width:30%;text-align:right">
180 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
181 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->tax_total)); ?>
182 </p>
183 </td>
184 </tr>
185 <?php endif; ?>
186
187 <?php if ($order->total_refund > 0 && $isRefund): ?>
188 <tr style="width:100%">
189 <td style="width:70%">
190 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
191 <?php echo esc_html__('Refund', 'fluent-cart'); ?>
192 </p>
193 </td>
194 <td style="width:30%;text-align:right">
195 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
196 - <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->total_refund)); ?>
197 </p>
198 </td>
199 </tr>
200 <?php endif; ?>
201
202 <tr style="width:100%">
203 <td style="width:70%"><p
204 style="font-size:16px;font-weight:700;color:rgb(17,24,39);line-height:24px;margin: 0;">
205 <?php echo esc_html__('Total', 'fluent-cart'); ?>
206 </p>
207 </td>
208 <td style="width:30%;text-align:right">
209 <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);line-height:24px;margin: 0;">
210 <?php echo esc_html(\FluentCart\Api\CurrencySettings::getFormattedPrice(($order->total_amount - $order->total_refund), null, false, true, true)); ?>
211 </p>
212 </td>
213 </tr>
214
215 <?php if ($order->total_refund > 0 && !$isRefund): ?>
216 <tr style="width:100%">
217 <td style="width:70%">
218 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
219 <?php echo esc_html__('Refund', 'fluent-cart'); ?>
220 </p>
221 </td>
222 <td style="width:30%;text-align:right">
223 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
224 - <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->total_refund)); ?>
225 </p>
226 </td>
227 </tr>
228 <?php endif; ?>
229
230 <tr style="width:100%">
231 <td style="width:70%">
232 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
233 <?php echo esc_html__('Payment Method', 'fluent-cart'); ?>
234 </p>
235 </td>
236 <td style="width:30%;text-align:right">
237 <p style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;">
238 <?php echo esc_html($transaction ? $transaction->getPaymentMethodText() : ''); ?>
239 </p>
240 </td>
241 </tr>
242 </tbody>
243 </table>
244 <?php
245 $orderTaxRates = $order->orderTaxRates->first();
246 $taxtotal = $order->tax_total + $order->shipping_tax;
247 if(Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.valid') && !$taxtotal): ?>
248 <div style="text-align: right; font-size: 14px; margin-top: 10px;">
249 <?php echo '*' . esc_html__('Tax to be paid on reverse charge basis', 'fluent-cart'); ?>
250 </div>
251
252 <?php endif ?>
253 </td>
254 </tr>
255 </table>
256
257
258
259