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

265 lines 13.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 \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 if (!empty($item['setup_info'])): ?>
70 <p style="font-size:12px;color:rgb(75,85,99);line-height:20px;margin: 3px 0 0 0;">
71 <?php echo wp_kses_post($item['setup_info']); ?>
72 </p>
73 <?php endif; ?>
74
75 <?php
76 $otherInfo = is_array($item['other_info'] ?? null) ? $item['other_info'] : [];
77 $packageInfo = Arr::get($item, 'package_info', '');
78 if (!$packageInfo && Arr::get($otherInfo, 'package_name')) {
79 $packageInfo = \FluentCart\App\Services\Renderer\ProductCardRender::buildPackageInfoFromOtherInfo($otherInfo);
80 }
81 if ($packageInfo):
82 ?>
83 <p style="font-size:12px;color:rgb(107,114,128);line-height:18px;margin: 5px 0 0 0;">
84 <?php echo esc_html($packageInfo); ?>
85 </p>
86 <?php endif; ?>
87 </p>
88 </td>
89 <td style="padding-right: 16px;text-align:right">
90 <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0;line-height:24px;">
91 <?php echo esc_html($item['formatted_total']); ?>
92 </p>
93 </td>
94 </tr>
95 <?php endforeach; ?>
96 </tbody>
97 </table>
98 <table style="border-spacing:0;padding: 0; width: 100%;border: none;">
99 <tr>
100 <td style="width: 50%;"></td>
101 <td style="width: 100%;">
102 <table role="presentation"
103 style="background-color:rgb(249,250,251);padding:16px;border-radius:8px;margin: 0; width: 100%;border: none;">
104 <tbody>
105 <?php if ($order->subtotal != $order->total_amount): ?>
106 <tr style="width:100%">
107 <td style="width:70%">
108 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
109 <?php echo esc_html__('Subtotal', 'fluent-cart'); ?>
110 </p>
111 </td>
112 <td style="width:30%;text-align:right">
113 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
114 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->subtotal)); ?>
115 </p>
116 </td>
117 </tr>
118 <?php endif; ?>
119
120 <?php if ($order->shipping_total > 0): ?>
121 <tr style="width:100%">
122 <td style="width:70%">
123 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
124 <?php echo esc_html__('Shipping', 'fluent-cart'); ?>
125 </p>
126 </td>
127 <td style="width:30%;text-align:right">
128 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
129 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->shipping_total)); ?>
130 </p>
131 </td>
132 </tr>
133 <?php endif; ?>
134 <?php if ($order->shipping_tax > 0): ?>
135 <tr style="width:100%">
136 <td style="width:70%">
137 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
138 <?php echo esc_html__('Shipping Tax', 'fluent-cart'); ?>
139 <?php echo esc_html($order->tax_behavior == 2 ? __('(Included)', 'fluent-cart') : __('(Excluded)', 'fluent-cart')); ?>
140 </p>
141 </td>
142 <td style="width:30%;text-align:right">
143 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
144 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->shipping_tax)); ?>
145 </p>
146 </td>
147 </tr>
148 <?php endif; ?>
149 <?php foreach ($feeItems as $feeItem): ?>
150 <tr style="width:100%">
151 <td style="width:70%">
152 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
153 <?php echo esc_html($feeItem['title']); ?>
154 </p>
155 </td>
156 <td style="width:30%;text-align:right">
157 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
158 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($feeItem['subtotal'])); ?>
159 </p>
160 </td>
161 </tr>
162 <?php endforeach; ?>
163 <?php if ($order->manual_discount_total + $order->coupon_discount_total > 0): ?>
164 <tr style="width:100%">
165 <td style="width:70%">
166 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
167 <?php echo esc_html__('Discount', 'fluent-cart'); ?>
168 </p>
169 </td>
170 <td style="width:30%;text-align:right">
171 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
172 - <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->manual_discount_total + $order->coupon_discount_total)); ?>
173 </p>
174 </td>
175 </tr>
176 <?php endif; ?>
177 <?php if ($order->tax_total > 0): ?>
178 <tr style="width:100%">
179 <td style="width:70%">
180 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
181 <?php echo esc_html__('Tax', 'fluent-cart'); ?>
182 <?php echo esc_html($order->tax_behavior == 2 ? __('(Included)', 'fluent-cart') : __('(Excluded)', 'fluent-cart')); ?>
183 </p>
184 </td>
185 <td style="width:30%;text-align:right">
186 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
187 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->tax_total)); ?>
188 </p>
189 </td>
190 </tr>
191 <?php endif; ?>
192
193 <?php if ($order->total_refund > 0 && $isRefund): ?>
194 <tr style="width:100%">
195 <td style="width:70%">
196 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
197 <?php echo esc_html__('Refund', 'fluent-cart'); ?>
198 </p>
199 </td>
200 <td style="width:30%;text-align:right">
201 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
202 - <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->total_refund)); ?>
203 </p>
204 </td>
205 </tr>
206 <?php endif; ?>
207
208 <tr style="width:100%">
209 <td style="width:70%"><p
210 style="font-size:16px;font-weight:700;color:rgb(17,24,39);line-height:24px;margin: 0;">
211 <?php echo esc_html__('Total', 'fluent-cart'); ?>
212 </p>
213 </td>
214 <td style="width:30%;text-align:right">
215 <p style="font-size:14px;font-weight:700;color:rgb(17,24,39);line-height:24px;margin: 0;">
216 <?php echo esc_html(\FluentCart\Api\CurrencySettings::getFormattedPrice(($order->total_amount - $order->total_refund), null, false, true, true)); ?>
217 </p>
218 </td>
219 </tr>
220
221 <?php if ($order->total_refund > 0 && !$isRefund): ?>
222 <tr style="width:100%">
223 <td style="width:70%">
224 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
225 <?php echo esc_html__('Refund', 'fluent-cart'); ?>
226 </p>
227 </td>
228 <td style="width:30%;text-align:right">
229 <p style="font-size:14px;color:rgb(55,65,81);margin:0;line-height:24px;">
230 - <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->total_refund)); ?>
231 </p>
232 </td>
233 </tr>
234 <?php endif; ?>
235
236 <tr style="width:100%">
237 <td style="width:70%">
238 <p style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
239 <?php echo esc_html__('Payment Method', 'fluent-cart'); ?>
240 </p>
241 </td>
242 <td style="width:30%;text-align:right">
243 <p style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;">
244 <?php echo esc_html($transaction ? $transaction->getPaymentMethodText() : ''); ?>
245 </p>
246 </td>
247 </tr>
248 </tbody>
249 </table>
250 <?php
251 $orderTaxRates = $order->orderTaxRates->first();
252 $taxtotal = $order->tax_total + $order->shipping_tax;
253 if(Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.valid') && !$taxtotal): ?>
254 <div style="text-align: right; font-size: 14px; margin-top: 10px;">
255 <?php echo '*' . esc_html__('Tax to be paid on reverse charge basis', 'fluent-cart'); ?>
256 </div>
257
258 <?php endif ?>
259 </td>
260 </tr>
261 </table>
262
263
264
265