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.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 trunk All 48 releases
fluent-cart / app / Views / invoice / receipt_slip.php

receipt_slip.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.3.26, at app/Views/invoice/receipt_slip.php

499 lines 29.8 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 <style>
3 html {
4 background-color: rgb(248, 249, 250);
5 font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
6 }
7
8 body {
9 background-color: rgb(248, 249, 250);
10 padding-top: 40px;
11 padding-bottom: 40px;
12 font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
13 }
14
15 p {
16 font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
17 font-size: 14px;
18 margin: 0px;
19 margin-bottom: 8px;
20 line-height: 24px;
21 }
22
23 .email_footer p {
24 font-size: 12px;
25 color: rgb(127, 140, 141);
26 margin: 0px;
27 line-height: 24px;
28 margin-bottom: 8px;
29 }
30
31 hr {
32 border-color: rgb(229, 231, 235);
33 margin-bottom: 20px;
34 width: 100%;
35 border: none;
36 border-top: 1px solid #eaeaea;
37 }
38
39 .space_bottom_30 {
40 display: block;
41 width: 100%;
42 margin-bottom: 30px;
43 }
44
45 .fct-transaction-table tr:last-child td {
46 border-bottom: none !important;
47 padding-bottom: 0 !important;
48 }
49 </style>
50
51 <?php
52
53 use FluentCart\Api\StoreSettings;
54 use FluentCart\Framework\Support\Arr;
55 use FluentCart\App\Helpers\AddressHelper;
56 use FluentCart\App\Modules\Tax\TaxModule;
57 use FluentCart\App\Services\DateTime\DateTime;
58
59 $settings = new StoreSettings();
60
61 /**
62 * @var $order
63 */
64
65 $profilePage = $settings->getCustomerProfilePage();
66 $orderTaxRates = $order->orderTaxRates->first();
67
68
69 ?>
70
71 <div style="background-color: #fff;max-width: 620px;margin-left: auto;margin-right: auto;border: 1px solid #e7eaee;padding: 10px;border-radius: 8px;">
72 <div style=" border-radius: 5px;" id="receipt">
73 <div class="fct-email-template-content email-template-content"
74 style="font-family: Arial, Helvetica, sans-serif; margin: 0 auto; padding: 0px; width: 100%;">
75
76 <div class="fct-email-template-content-inner" style="font-size: 13px;line-height: 1.4;color: #333;">
77 <div style="padding: 20px;">
78
79 <table role="presentation"
80 style="width: 100%;border-collapse: collapse;margin-bottom: 10px;border: none;">
81 <tbody style="width:100%">
82 <tr style="width:100%">
83 <td style="width:60%;border: none;">
84 <h1 style="font-size:24px;font-weight:700;color:rgb(17,24,39);margin:0px">
85 <?php
86 $imageLink = $settings->get('store_logo.url');
87 $storeName = $settings->get('store_name');
88 if (empty($imageLink)) {
89 echo esc_html($storeName);
90 } else {
91 echo "<img src=".esc_url($imageLink)." alt=".esc_attr($storeName)." style='max-height: 40px;'>";
92 }
93 ?>
94 </h1>
95
96 <!-- show tax content -->
97 <?php
98 $storeVatNumber = Arr::get($orderTaxRates->meta ?? [], 'store_vat_number', '');
99 $taxcountry = Arr::get($orderTaxRates->meta ?? [], 'tax_country', '');
100 if (!empty($storeVatNumber)): ?>
101 <span class="fct_invoice_tax_content" style="font-weight: 500; font-size: 14px;">
102 <?php echo esc_html(TaxModule::getCountryTaxTitle($taxcountry)); ?>:
103 <?php
104 if ($storeVatNumber !== '') {
105 echo esc_html($storeVatNumber);
106 }
107 ?>
108 </span>
109 <?php endif; ?>
110 </td>
111 <td style="vertical-align: middle; width: 15%; text-align: right; border: none;padding-right: 10px;">
112 <p style="white-space: nowrap; color: #94a3b8; text-align: right; margin: 0;font-size:12px;">
113 <?php echo esc_html__('Order At', 'fluent-cart'); ?>
114 </p>
115 <p style="white-space: nowrap; font-weight: bold; color: #000; text-align: right; margin: 0;font-size:14px;">
116 <?php
117 echo esc_html(
118 date_i18n(
119 /* translators: Date format for order creation date */
120 __('M d, Y', 'fluent-cart'),
121 DateTime::anyTimeToGmt($order->created_at)->getTimestamp()
122 )
123 );
124 ?>
125 </p>
126 </td>
127 <td style="width:15%;text-align:right;border:none;vertical-align:baseline;">
128 <p style="white-space: nowrap; color: #94a3b8; text-align: right; margin: 0;font-size:12px;">
129 <?php echo esc_html__('Invoice number #', 'fluent-cart'); ?>
130 </p>
131 <p id="fct-order-invoice-no"
132 style="white-space: nowrap; font-weight: bold; color: #000; text-align: right; margin: 0;font-size:14px;">
133 <?php echo esc_html($order->invoice_no); ?>
134 </p>
135 </td>
136 </tr>
137 </tbody>
138 </table>
139
140 <?php if ($order->fulfillment_type === 'physical') : ?>
141 <div style="background: #f8f9fa;padding: 15px;margin-bottom: 20px;">
142 <div style="font-size: 18px;font-weight: bold;margin-bottom: 8px;">
143 <?php echo esc_html($settings->get('store_name')); ?>
144 </div>
145 <div style="margin-bottom: 3px;">
146 <?php echo esc_html($settings->get('store_address1')); ?>
147 </div>
148
149 <div>
150 <?php echo esc_html(AddressHelper::getStateNameByCode(
151 $settings->get('store_state'),
152 $settings->get('store_country')
153 )); ?>
154 <?php echo esc_html(AddressHelper::getCountryNameByCode($settings->get('store_country'))); ?>
155 </div>
156 </div>
157 <?php endif; ?>
158
159 <div style="display: grid;grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));gap: 20px;">
160 <?php if ($order->fulfillment_type === 'digital') : ?>
161 <div style="border-radius: 5px;print-color-adjust: exact;">
162 <h5 style="font-weight: bold;font-size: 14px;margin: 0 0 10px 0;color: #495057;border-bottom: 1px solid #dee2e6;padding-bottom: 5px;">
163 <?php echo esc_html($settings->get('store_name')); ?>
164 </h5>
165 <div style="margin-bottom: 3px;">
166 <?php echo esc_html($settings->get('store_address1')); ?>
167 </div>
168 <div>
169 <?php echo esc_html(AddressHelper::getStateNameByCode(
170 $settings->get('store_state'),
171 $settings->get('store_country')
172 )); ?>
173 <?php echo esc_html(AddressHelper::getCountryNameByCode($settings->get('store_country'))); ?>
174 </div>
175 </div>
176 <?php endif; ?>
177 <div style="border-radius: 5px;print-color-adjust: exact;">
178 <h5 style="font-weight: bold;font-size: 14px;margin: 0 0 10px 0;color: #495057;border-bottom: 1px solid #dee2e6;padding-bottom: 5px;">
179 <?php echo esc_html__('Bill To', 'fluent-cart'); ?>
180 </h5>
181 <?php if (!empty($order->billing_address)) : ?>
182
183 <div style="margin-bottom: 3px;">
184 <?php echo esc_html($order->billing_address->getAddressAsText()); ?>
185 </div>
186 <?php if (!empty($vat_tax_id)) : ?>
187 <div style="margin-bottom: 3px;">
188 <?php echo esc_html__('VAT/Tax ID: ', 'fluent-cart'). esc_html($vat_tax_id); ?>
189 </div>
190 <?php endif; ?>
191 <div style="margin-top: 10px;">
192 <?php echo esc_html($order->customer->email); ?>
193 </div>
194 <?php
195 $phoneNumber = Arr::get($order->billing_address->meta ?? [], 'other_data.phone', '');
196 if ($phoneNumber !== ''):
197 ?>
198 <div style="margin-top: 3px;">
199 <?php echo esc_html($phoneNumber); ?>
200 </div>
201 <?php endif; ?>
202 <div>
203 <?php
204 $companyName = Arr::get($order->billing_address->meta ?? [], 'other_data.company_name', '');
205 if ($companyName == '') {
206 $companyName = Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.name', '');
207 }
208 echo esc_html($companyName);
209 ?>
210 </div>
211 <div style="margin-top: 5px;">
212 <?php
213 $vatNumber = Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.vat_number', '');
214
215 if ($vatNumber !== '') {
216 echo esc_html__('EU VAT', 'fluent-cart') . ': ' . esc_html($vatNumber);
217 }
218 ?>
219 </div>
220
221 <?php else: ?>
222 <div style="margin-top: 10px;">
223 <?php echo esc_html($order->customer->full_name); ?>
224 </div>
225 <?php if (!empty($vat_tax_id)) : ?>
226 <div style="margin-bottom: 3px;">
227 <?php echo esc_html__('VAT/Tax ID: ', 'fluent-cart'). esc_html($vat_tax_id); ?>
228 </div>
229 <?php endif; ?>
230 <div style="margin-top: 3px;">
231 <?php echo esc_html($order->customer->email); ?>
232 </div>
233 <?php endif; ?>
234 </div>
235 <?php if ($order->fulfillment_type === 'physical') : ?>
236 <div style="border-radius: 5px;print-color-adjust: exact;">
237 <h5 style="font-weight: bold;font-size: 14px;margin: 0 0 10px 0;color: #495057;border-bottom: 1px solid #dee2e6;padding-bottom: 5px;">
238 <?php echo esc_html__('Ship To', 'fluent-cart'); ?>
239 </h5>
240 <?php if (!empty($order->shipping_address)) : ?>
241 <div style="margin-bottom: 3px;">
242 <?php echo esc_html($order->shipping_address->getAddressAsText()); ?>
243 </div>
244 <?php
245 $phone = Arr::get($order->shipping_address->meta ?? [], 'other_data.phone', '');
246 if ($phone !== ''):
247 ?>
248 <div style="margin-top: 3px;">
249 <?php echo esc_html($phone); ?>
250 </div>
251 <?php endif; ?>
252 <?php else: ?>
253 <div style="margin-top: 10px;">
254 <?php echo esc_html($order->customer->full_name); ?>
255 </div>
256 <div style="margin-top: 3px;">
257 <?php echo esc_html($order->customer->email); ?>
258 </div>
259 <?php endif; ?>
260 </div>
261 <?php endif; ?>
262 </div>
263
264 <?php if ($order->order_items) : ?>
265 <table style="margin-top: 20px;margin-bottom: 10px;width: 100%;text-align: left;border-spacing: 0;border-collapse: collapse;border: none;">
266 <thead>
267 <tr>
268 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold;print-color-adjust: exact;border: none;">
269 <?php echo esc_html__('Description', 'fluent-cart'); ?>
270 </th>
271 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold;width: 80px;text-align: right;print-color-adjust: exact;border: none;">
272 <?php echo esc_html__('Qty', 'fluent-cart'); ?>
273 </th>
274 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold;width: 80px;text-align: right;print-color-adjust: exact;border: none;">
275 <?php echo esc_html__('Unit price', 'fluent-cart'); ?>
276 </th>
277 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold;width: 80px;text-align: right;print-color-adjust: exact;border: none;">
278 <?php echo esc_html__('Amount', 'fluent-cart'); ?>
279 </th>
280 </tr>
281 </thead>
282 <tbody>
283 <?php
284 $orderItems = $order->getProductItems()->toArray();
285 $transaction = $order->getLatestTransaction();
286
287 foreach ($orderItems as $item) :
288 ?>
289 <tr>
290 <td style="font-size:15px;padding: 12px 8px;border: none;border-bottom: 1px solid #dee2e6;print-color-adjust: exact;">
291 <?php echo esc_html($item['post_title']); ?>
292 <br>
293 <?php if (!empty($item['title'])) : ?>
294 <small style="font-size: 13px;color: #758195;">- <?php echo esc_html($item['title']); ?></small>
295 <br>
296 <?php endif; ?>
297 <?php if (!empty($item['payment_info'])) : ?>
298 <small style="font-size: 13px;color: #758195;"><?php echo esc_html($item['payment_info']); ?></small>
299 <?php endif; ?>
300 </td>
301 <td style="padding: 12px 8px;border: none;border-bottom: 1px solid #dee2e6;text-align: right;">
302 <?php echo esc_html($item['quantity']); ?>
303 </td>
304 <td style="padding: 12px 8px;border: none;border-bottom: 1px solid #dee2e6;text-align: right">
305 <?php echo esc_html(\FluentCart\Api\CurrencySettings::getFormattedPrice($item['unit_price'])); ?>
306 </td>
307 <td style="padding: 12px 8px;border: none;border-bottom: 1px solid #dee2e6;text-align: right">
308 <?php echo esc_html($item['formatted_total']); ?>
309 </td>
310 </tr>
311 <?php endforeach; ?>
312 </tbody>
313 </table>
314
315 <div style="margin-top: 20px;">
316 <table style="max-width: 250px;width: 100%;margin-left: auto;border-collapse: collapse;background: #f8f9fa;print-color-adjust: exact;border: none;">
317 <tbody>
318 <?php
319 if ($order->subtotal != ($order->total_amount - $order->total_refund) || $order->tax_total > 0): ?>
320 <tr>
321 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
322 <?php echo esc_html__('Subtotal', 'fluent-cart'); ?>
323 </td>
324 <td style="font-weight:700;padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
325 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->subtotal));
326 ?>
327 </td>
328 </tr>
329 <?php endif; ?>
330 <?php if ($order->manual_discount_total + $order->coupon_discount_total > 0): ?>
331 <tr>
332 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
333 <?php echo esc_html__('Discount', 'fluent-cart'); ?>
334 </td>
335 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
336 - <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->manual_discount_total + $order->coupon_discount_total)); ?>
337 </td>
338 </tr>
339 <?php endif; ?>
340 <?php if ($order->shipping_total > 0): ?>
341 <tr>
342 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
343 <?php echo esc_html__('Shipping', 'fluent-cart'); ?>
344 </td>
345 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
346 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->shipping_total)); ?>
347 </td>
348 </tr>
349 <?php endif; ?>
350 <?php
351 $feeItems = $order->feeItems()->get();
352 foreach ($feeItems as $feeItem): ?>
353 <tr>
354 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
355 <?php echo esc_html($feeItem->title); ?>
356 </td>
357 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
358 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($feeItem->subtotal)); ?>
359 </td>
360 </tr>
361 <?php endforeach; ?>
362 <?php if ($order->tax_total > 0): ?>
363 <tr>
364 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
365 <?php echo esc_html__('Tax', 'fluent-cart');
366 echo esc_html( $order->tax_behavior == 2 ? __('(Included)', 'fluent-cart') : __('(Excluded)', 'fluent-cart'));
367 ?>
368 </td>
369 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
370 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->tax_total)); ?>
371 </td>
372 </tr>
373 <?php endif; ?>
374 <?php if ($order->shipping_tax > 0): ?>
375 <tr>
376 <td style="padding: 8px 20px 8px 0;text-align: right;border: none;">
377 <?php echo esc_html__('Shipping Tax', 'fluent-cart');
378 echo esc_html( $order->tax_behavior == 2 ? __('(Included)', 'fluent-cart') : __('(Excluded)', 'fluent-cart'));
379 ?>
380 </td>
381 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border: none;">
382 <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->shipping_tax)); ?>
383 </td>
384 </tr>
385 <?php endif; ?>
386
387 <?php if ($order->total_refund > 0): ?>
388 <tr style="font-weight: bold;font-size: 14px;">
389 <td style="font-weight:500;padding: 8px 20px 8px 0;text-align: right;border:none;">
390 <?php echo esc_html__('Refund', 'fluent-cart'); ?>
391 </td>
392 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border:none;">
393 - <?php echo esc_html(\FluentCart\App\Helpers\Helper::toDecimal($order->total_refund)); ?>
394 </td>
395 </tr>
396 <?php endif; ?>
397 <tr style="font-weight: bold;font-size: 14px;">
398 <td style="font-weight:500;padding: 8px 20px 8px 0;text-align: right;border:none;">
399 <?php echo esc_html__('Total', 'fluent-cart'); ?>
400 </td>
401 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border:none;">
402 <?php echo esc_html(\FluentCart\Api\CurrencySettings::getFormattedPrice($order->total_amount - $order->total_refund)); ?>
403 </td>
404 </tr>
405 <tr style="font-weight: bold;font-size: 14px;">
406 <td style="font-weight:500;padding: 8px 20px 8px 0;text-align: right;border:none;">
407 <?php echo esc_html__('Amount Paid', 'fluent-cart'); ?>
408 </td>
409 <td style="padding: 8px 8px 8px 0;width: 100px;text-align: right;border:none;">
410 <?php echo esc_html(\FluentCart\Api\CurrencySettings::getFormattedPrice($order->total_paid - $order->total_refund)); ?>
411 </td>
412 </tr>
413 </tbody>
414 </table>
415 </div>
416 <?php endif; ?>
417
418 <!-- tax note -->
419 <?php
420 $taxtotal = $order->tax_total + $order->shipping_tax;
421 if(Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.valid') && !$taxtotal): ?>
422
423 <div style="text-align: right; font-size: 14px; margin-top: 10px;">
424 <?php echo '*' . esc_html__('Tax to be paid on reverse charge basis', 'fluent-cart'); ?>
425 </div>
426
427 <?php endif ?>
428
429 <?php
430 $transactions = $order->transactions;
431 if (!empty($transactions)) :
432 ?>
433 <div style="margin-top: 30px;">
434 <div style="font-weight: bold;font-size: 14px;color: #495057;margin: 0;padding: 0;">
435 <?php echo esc_html__('Payment history', 'fluent-cart'); ?>
436 </div>
437 <table class="fct-transaction-table"
438 style="margin-top: 10px;width: 100%;text-align: left;border-spacing: 0;border-collapse: collapse;border: none;">
439 <thead>
440 <tr>
441 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold;print-color-adjust: exact;border:none;">
442 <?php echo esc_html__('Payment method', 'fluent-cart'); ?>
443 </th>
444 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold; text-align: center;print-color-adjust: exact;border:none;">
445 <?php echo esc_html__('Date', 'fluent-cart'); ?>
446 </th>
447 <th style="background-color: #f8f9fa;padding: 12px 8px;font-weight: bold; text-align: right;print-color-adjust: exact;border:none;">
448 <?php echo esc_html__('Amount', 'fluent-cart'); ?>
449 </th>
450 </tr>
451 </thead>
452 <tbody>
453 <?php foreach ($transactions as $transaction) :
454 if ($transaction->transaction_type === 'refund') {
455 continue;
456 }
457 ?>
458 <tr>
459 <td style="padding: 10px;border:none;border-bottom: 1px solid #dee2e6;">
460 <?php echo esc_html($transaction->getPaymentMethodText()); ?>
461 </td>
462 <td style="padding: 10px;border:none;border-bottom: 1px solid #dee2e6;text-align: center;">
463 <?php
464 echo esc_html(
465 date_i18n(
466 /* translators: Date format for order creation date */
467 __('M d, Y', 'fluent-cart'),
468 DateTime::anyTimeToGmt($transaction->created_at)->getTimestamp()
469 )
470 );
471 ?>
472 </td>
473 <td style="padding: 10px;border:none;border-bottom: 1px solid #dee2e6;text-align: right;">
474 <?php echo esc_html(\FluentCart\Api\CurrencySettings::getFormattedPrice($transaction->total)); ?>
475 </td>
476 </tr>
477 <?php endforeach; ?>
478 </tbody>
479 </table>
480 </div>
481 <?php endif; ?>
482
483 </div>
484 </div>
485 </div>
486 <?php
487 // include(__DIR__ . '/../emails/components/cta.php')
488 ?>
489 </div>
490 </div>
491
492
493 <?php if ($is_first_time) {
494 do_action('fluent_cart/order/receipt_viewed', [
495 'order' => $order,
496 'order_operation' => $order_operation
497 ]);
498 } ?>
499