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

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

481 lines 32.3 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 use FluentCart\App\App;
5 use FluentCart\Api\StoreSettings;
6 use FluentCart\App\Helpers\Helper;
7 use FluentCart\Framework\Support\Arr;
8 use FluentCart\App\Modules\Tax\TaxModule;
9
10 $settings = new StoreSettings();
11 $profilePage = $settings->getCustomerProfilePage();
12
13 $bgColor = '#d4edda';
14 $titleColor = '#155724';
15 $iconBg = '#155724bd';
16
17 if ($order->payment_status !== 'paid') {
18 $bgColor = '#fff3cd';
19 $titleColor = '#856404';
20 $iconBg = '#856404bd';
21 }
22 ?>
23
24 <div>
25 <div style=" padding: 10px; border-radius: 5px;">
26 <div class="email-template-content"
27 style="font-family: Arial, Helvetica, sans-serif; max-width: 620px; margin: 0 auto; padding: 0px; width: 100%;">
28
29 <div
30 style="margin-bottom: 10px;background: <?php echo esc_attr($bgColor); ?>;padding: 30px 30px;border-radius: 4px;text-align: center;color: white;">
31 <?php if ($order->payment_status !== 'paid') : ?>
32 <div
33 style="width: 80px;height: 80px;border-radius: 50%;background: <?php echo esc_attr($iconBg); ?>;display: inline-flex ;align-items: center;justify-content: center;margin-bottom: 20px;">
34 <svg style="width: 40px;height: 40px;" class="w-64 h-64" xmlns="http://www.w3.org/2000/svg"
35 viewBox="0 0 1024 1024" fill="currentColor">
36 <path
37 d="M480 674V192c0-18 14-32 32-32s32 14 32 32v482h-64zm0 63h64v60h-64v-60zM0 512C0 229 229 0 512 0s512 229 512 512-229 512-512 512S0 795 0 512zm961 0c0-247-202-448-449-448S64 265 64 512s201 448 448 448 449-201 449-448z"></path>
38 </svg>
39 </div>
40 <h1 style="font-size: 2em;line-height: 1;margin: 0;font-weight: 700;color:<?php echo esc_attr($titleColor); ?>">
41 <?php echo esc_html__('Payment Pending!', 'fluent-cart'); ?>
42 </h1>
43
44 <?php else: ?>
45 <div
46 style="width: 80px;height: 80px;border-radius: 50%;background: <?php echo esc_attr($iconBg); ?>;display: inline-flex ;align-items: center;justify-content: center;margin-bottom: 20px;">
47 <svg style="width: 40px;height: 40px;" viewBox="0 0 24 24" fill="none" stroke="currentColor"
48 stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
49 <polyline points="20,6 9,17 4,12"></polyline>
50 </svg>
51 </div>
52 <h1 style="font-size: 2em;line-height: 1;margin: 0;font-weight: 700;color:<?php echo esc_attr($titleColor); ?>">
53 <?php echo esc_html__('Purchase Successful!', 'fluent-cart'); ?>
54 </h1>
55 <?php endif; ?>
56 </div>
57
58 <div style="background-color: #fff; border-radius: 8px; border: 1px solid #e7eaee; ">
59 <div style="padding: 20px;">
60 <div style="overflow-x: hidden">
61 <div style="background-color: #ffffff; padding: 0px;">
62
63 <div class="no-print" style="margin-bottom: 16px;text-align: left; padding: 0;">
64 <p style="font-size: 24px;font-weight: 600;line-height: 1.2; margin: 0 0 4px 0; color: #2F3448;">
65 <?php
66 echo sprintf(
67 /* translators: %s is the customer's full name */
68 esc_html__('Hello %s!', 'fluent-cart'),
69 esc_html($order->customer->full_name)
70 );
71 ?>
72 </p>
73 <?php if ($order->payment_status === 'paid') : ?>
74 <p style="font-size: 14px; margin: 0; color: #2F3448;">
75 <?php
76 printf(
77 '%s<strong style="color: #007bff;"><a href="%s">#%s</a></strong>%s',
78 esc_html__('Your order ', 'fluent-cart'),
79 esc_url($profilePage . 'order/' . $order->uuid),
80 esc_html($order->invoice_no),
81 esc_html__(' has been placed successfully.', 'fluent-cart')
82 );
83 ?>
84 </p>
85 <?php else: ?>
86 <p style="font-size: 14px; margin: 0; color: #2F3448;">
87
88 <?php
89 printf(
90 '<strong style="color: #007bff;"><a href="%s">%s</a></strong> %s <a style="color: #007bff;" target="_blank" href="%s">%s</a>.',
91 esc_url($profilePage . 'order/' . $order->uuid),
92 esc_html__('Your order', 'fluent-cart'),
93 esc_html__('has payment due. You can pay from', 'fluent-cart'),
94 esc_url(\FluentCart\App\Services\Payments\PaymentHelper::getCustomPaymentLink($order->uuid)),
95 esc_html__('here', 'fluent-cart')
96 );
97 ?>
98
99 </p>
100 <?php endif; ?>
101
102 </div>
103
104 <!-- show tax content -->
105 <?php
106 $orderTaxRates = $order->orderTaxRates->first();
107 if ($order->tax_total > 0 || $orderTaxRates): ?>
108 <div class="fct_invoice_tax_content" style="text-align: right;">
109 <?php
110 if ($orderTaxRates) {
111 $storeVatNumber = Arr::get($orderTaxRates->meta, 'store_vat_number', '');
112 $taxcountry = Arr::get($orderTaxRates->meta ?? [], 'tax_country', '');
113 if ($storeVatNumber !== '') {
114 echo '<p style="font-weight: 600; font-size: 14px;margin-bottom:12px;">' . esc_html(TaxModule::getCountryTaxTitle($taxcountry)) . ': ' . esc_html($storeVatNumber) . '</p>';
115 }
116 }
117 ?>
118 </div>
119 <?php endif; ?>
120
121
122
123 <?php if ($order->order_items) : ?>
124 <div>
125 <div
126 style="display: flex;justify-content: space-between;background: rgb(249,250,251);padding: 0 16px;">
127 <div
128 style="font-size: 12px;font-weight: 600;color: rgb(55, 65, 81);text-transform: uppercase;line-height: 24px;margin: 0;text-align: left;">
129 <?php echo esc_html__('Item', 'fluent-cart'); ?>
130 </div>
131 <div
132 style="width: 200px;text-align:right;font-size: 12px;font-weight: 600;color: rgb(55, 65, 81);text-transform: uppercase;line-height: 24px;margin: 0;">
133 <?php echo esc_html__('Total', 'fluent-cart'); ?>
134 </div>
135 </div>
136
137 <div>
138 <?php
139 $orderItems = $order->getProductItems()->toArray();
140 $transaction = $order->getLatestTransaction();
141
142 foreach ($orderItems as $item) :
143 ?>
144 <div
145 style="display: flex;align-items: flex-start;justify-content: space-between;padding: 8px 16px;">
146 <div>
147 <p style="font-size: 15px; color: #2F3448; font-weight: 500; overflow: hidden; line-height: 18px; margin-top: 0; margin-bottom: 5px;">
148 <?php echo esc_html($item['post_title']); ?>
149 <?php if ($item['quantity'] > 1): ?>
150 <span
151 style="font-size:12px;font-weight:400;color:rgb(75,85,99)">x <?php echo esc_html($item['quantity']); ?></span>
152 <?php endif; ?>
153 </p>
154 <p style="margin: 0; font-size: 14px; color: #758195; font-weight: 400; line-height: 15px;">
155 - <?php echo esc_html($item['title']); ?>
156 </p>
157 <?php if ($item['payment_type'] === 'subscription' && !empty($item['payment_info'])): ?>
158 <p style="font-size:12px;color:rgb(75,85,99);line-height:20px;margin: 3px 0 0 0;">
159 <?php echo wp_kses_post($item['payment_info']) ?>
160 </p>
161 <?php endif; ?>
162 </div>
163 <div style="width: 200px;text-align: right;">
164 <div
165 style="font-size:14px;font-weight:700;color:rgb(17,24,39);margin:0;line-height:24px;">
166 <?php echo esc_html($item['formatted_total']); ?>
167 </div>
168 </div>
169 </div>
170 <?php endforeach; ?>
171
172 <div
173 style="background-color:rgb(249,250,251);padding:16px;border-radius:8px;margin: 0; width: 100%;max-width: 290px;margin-left: auto;">
174 <?php if ($order->subtotal != $order->total_amount || $order->tax_total > 0): ?>
175 <div
176 style="display: flex;align-items: center; justify-content: space-between;">
177 <div
178 style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
179 <?php echo esc_html__('Subtotal', 'fluent-cart'); ?>
180 </div>
181 <div
182 style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right"><?php echo esc_html(Helper::toDecimal($order->subtotal)); ?></div>
183 </div>
184 <?php endif; ?>
185 <?php if ($order->manual_discount_total + $order->coupon_discount_total > 0): ?>
186 <div
187 style="display: flex;align-items: center; justify-content: space-between;">
188 <div
189 style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
190 <?php echo esc_html__('Discount', 'fluent-cart'); ?>
191 </div>
192 <div
193 style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right">
194 - <?php echo esc_html(Helper::toDecimal($order->manual_discount_total + $order->coupon_discount_total)); ?>
195 </div>
196 </div>
197 <?php endif; ?>
198 <?php if ($order->shipping_total > 0): ?>
199 <div
200 style="display: flex;align-items: center; justify-content: space-between;">
201 <div
202 style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
203 <?php echo esc_html__('Shipping', 'fluent-cart'); ?>
204 </div>
205 <div
206 style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right"><?php echo esc_html(Helper::toDecimal($order->shipping_total)); ?></div>
207 </div>
208 <?php endif; ?>
209 <?php
210 $feeItems = $order->feeItems()->get();
211 foreach ($feeItems as $feeItem): ?>
212 <div
213 style="display: flex;align-items: center; justify-content: space-between;">
214 <div
215 style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
216 <?php echo esc_html($feeItem->title); ?>
217 </div>
218 <div
219 style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right"><?php echo esc_html(Helper::toDecimal($feeItem->subtotal)); ?></div>
220 </div>
221 <?php endforeach; ?>
222 <?php if ($order->tax_total > 0): ?>
223 <div
224 style="display: flex;align-items: center; justify-content: space-between;">
225 <div
226 style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
227 <?php echo esc_html__('Total Tax', 'fluent-cart'); ?>
228 <?php echo $order->tax_behavior == 2 ? esc_html__('(Included)', 'fluent-cart') : esc_html__('(Excluded)', 'fluent-cart'); ?>
229 </div>
230 <div
231 style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right">
232 <?php echo esc_html(Helper::toDecimal($order->tax_total)); ?>
233 </div>
234 </div>
235 <?php endif; ?>
236 <?php if ($order->shipping_tax > 0): ?>
237 <div
238 style="display: flex;align-items: center; justify-content: space-between;">
239 <div
240 style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
241 <?php echo esc_html__('Shipping Tax', 'fluent-cart'); ?>
242 <?php echo $order->tax_behavior == 2 ? esc_html__('(Included)', 'fluent-cart') : esc_html__('(Excluded)', 'fluent-cart'); ?>
243 </div>
244 <div
245 style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right">
246 <?php echo esc_html(Helper::toDecimal($order->shipping_tax)); ?>
247 </div>
248 </div>
249 <?php endif; ?>
250
251
252 <?php if ($order->total_refund > 0): ?>
253 <div
254 style="display: flex;align-items: center; justify-content: space-between;">
255 <div
256 style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
257 <?php echo esc_html__('Refund', 'fluent-cart'); ?>
258 </div>
259 <div
260 style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right">
261 - <?php echo esc_html(Helper::toDecimal($order->total_refund)); ?>
262 </div>
263 </div>
264 <?php endif; ?>
265 <div
266 style="display: flex;align-items: center; justify-content: space-between;">
267 <div
268 style="font-size:16px;font-weight:700;color:rgb(55,65,81);line-height:24px;margin: 0;">
269 <?php echo esc_html__('Total', 'fluent-cart'); ?>
270 </div>
271 <div
272 style="text-transform:uppercase;font-size:14px;font-weight:700;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right">
273 <?php echo esc_html(Helper::toDecimal($order->total_amount - $order->total_refund)); ?>
274 </div>
275 </div>
276 <div
277 style="display: flex;align-items: center; justify-content: space-between;">
278 <div
279 style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;">
280 <?php echo esc_html__('Payment Method', 'fluent-cart'); ?>
281 </div>
282 <div
283 style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right">
284 <?php if ($transaction->card_last_4) :
285 echo esc_html($transaction->card_brand) . ' ' . esc_html($transaction->card_last_4);
286 else:
287 echo esc_html($transaction->payment_method);
288 endif; ?>
289 </div>
290 </div>
291 </div>
292
293 <!-- tax note -->
294 <?php
295 $taxtotal = $order->tax_total + $order->shipping_tax;
296 if(Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.valid') && !$taxtotal): ?>
297
298 <div style="text-align: right; font-size: 14px; margin-top: 10px;">
299 <?php echo '*' . esc_html__('Tax to be paid on reverse charge basis', 'fluent-cart'); ?>
300 </div>
301
302 <?php endif ?>
303
304
305 </div>
306 </div>
307 <?php endif; ?>
308
309 <?php
310
311 App::make('view')->render('invoice.parts.subscription_items', [
312 'subscriptions' => $order->subscriptions,
313 'order' => $order
314 ])
315 ?>
316
317 <?php
318 $downloads = $order->getDownloads();
319 $licenses = $order->getLicenses();
320 if ($downloads) {
321 \FluentCart\App\App::make('view')->render('emails.parts.downloads', [
322 'order' => $order,
323 'heading' => 'Downloads',
324 'downloadItems' => $downloads ?: [],
325 'show_notice' => false
326 ]);
327 }
328
329 if ($licenses && $licenses->count() > 0) {
330 \FluentCart\App\App::make('view')->render('emails.parts.licenses', [
331 'licenses' => $licenses,
332 'heading' => 'Licenses',
333 'show_notice' => false
334 ]);
335 }
336 ?>
337
338 <?php if ($order->fulfillment_type === 'physical') : ?>
339 <div
340 class="fct-thank-you-page-order-items-addresses"
341 style="display: grid;grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));gap: 20px;margin-top: 20px;">
342
343 <div class="fct-thank-you-page-order-items-addresses-bill-to" style="font-size:14px;border-radius: 5px;">
344 <h5 style="font-weight: bold;font-size: 14px;margin: 0 0 10px 0;color: #495057;border-bottom: 1px solid #dee2e6;padding-bottom: 5px;">
345 <?php echo esc_html__('Bill To', 'fluent-cart'); ?>
346 </h5>
347 <?php
348 if (!empty($order->billing_address)) :
349 ?>
350 <div
351 class="fct-thank-you-page-order-items-addresses-bill-to-address"
352 style="margin-bottom: 3px;">
353 <?php echo esc_html($order->billing_address->getAddressAsText()); ?>
354 </div>
355
356 <div
357 class="fct-thank-you-page-order-items-addresses-bill-to-email"
358 style="margin-top: 10px;">
359 <?php echo esc_html($order->customer->email); ?>
360 </div>
361 <?php else: ?>
362 <div
363 class="fct-thank-you-page-order-items-addresses-bill-to-name"
364 style="margin-top: 10px;">
365 <?php echo esc_html($order->customer->full_name); ?>
366 </div>
367 <div
368 class="fct-thank-you-page-order-items-addresses-bill-to-email"
369 style="margin-top: 3px;">
370 <?php echo esc_html($order->customer->email); ?>
371 </div>
372 <?php endif; ?>
373 <?php
374 $phoneNumber = Arr::get($order->billing_address->meta ?? [], 'other_data.phone', '');
375 if ($phoneNumber !== ''):
376 ?>
377 <div class="fct-thank-you-page-order-items-addresses-bill-to-phone">
378 <?php echo esc_html($phoneNumber); ?>
379 </div>
380 <?php endif; ?>
381 <div class="fct-thank-you-page-order-items-addresses-bill-to-company-name">
382 <?php
383 $companyName = Arr::get($order->billing_address->meta ?? [], 'other_data.company_name', '');
384
385 if ($companyName === '') {
386 $companyName = Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.name', '');
387 }
388 echo esc_html($companyName);
389 ?>
390 </div>
391 <div class="fct-thank-you-page-order-items-addresses-bill-to-vat-number">
392 <?php
393 $vatNumber = Arr::get($orderTaxRates->meta ?? [], 'vat_reverse.vat_number', '');
394 if ($vatNumber !== '') {
395 echo esc_html__('EU VAT', 'fluent-cart') . ': ' . esc_html($vatNumber);
396 }
397 ?>
398 </div>
399 </div>
400 <div
401 class="fct-thank-you-page-order-items-addresses-ship-to"
402 style="font-size:14px;border-radius: 5px;">
403 <h5 class="fct-thank-you-page-order-items-addresses-ship-to-title" style="font-weight: bold;font-size: 14px;margin: 0 0 10px 0;color: #495057;border-bottom: 1px solid #dee2e6;padding-bottom: 5px;">
404 <?php echo esc_html__('Ship To', 'fluent-cart'); ?>
405 </h5>
406 <?php if (!empty($order->shipping_address)) : ?>
407 <div
408 class="fct-thank-you-page-order-items-addresses-ship-to-address"
409 style="margin-bottom: 3px;">
410 <?php echo esc_html($order->shipping_address->getAddressAsText()); ?>
411 </div>
412 <!-- show phone number -->
413 <?php
414 $phone = Arr::get($order->shipping_address->meta ?? [], 'other_data.phone', '');
415 if ($phone !== ''):?>
416 <div class="fct-thank-you-page-order-items-addresses-ship-to-phone">
417 <?php echo esc_html($phone); ?>
418 </div>
419 <?php endif; ?>
420 <?php else: ?>
421 <div
422 class="fct-thank-you-page-order-items-addresses-ship-to-name"
423 style="margin-top: 10px;">
424 <?php echo esc_html($order->customer->full_name); ?>
425 </div>
426 <div
427 class="fct-thank-you-page-order-items-addresses-ship-to-email"
428 style="margin-top: 3px;">
429 <?php echo esc_html($order->customer->email); ?>
430 </div>
431 <?php endif; ?>
432 </div>
433 </div>
434 <?php endif; ?>
435
436 </div>
437 </div>
438 </div>
439 </div>
440
441 </div>
442 <?php
443 // include(__DIR__ . '/../emails/components/cta.php')
444 ?>
445 </div>
446 </div>
447
448 <div style="text-align: center;margin-top: 10px;display: flex;align-items: center;justify-content: center;gap: 10px;">
449 <a href="<?php echo esc_url($profilePage . 'order/' . $order->uuid); ?>"
450 style="background: var(--fluent-cart-primary-color, #253241); color: #fff; padding: 7px 20px; border-radius: 8px; border: none; font-size: 16px; font-weight: 500; text-decoration:none;display:inline-block;">
451 <?php echo esc_html__('View Order', 'fluent-cart'); ?>
452 </a>
453 <a href="<?php echo esc_url(\FluentCart\App\Services\URL::appendQueryParams(
454 home_url(),
455 [
456 'fluent-cart' => 'receipt',
457 'order_hash' => esc_attr($order->uuid),
458 'download' => 1
459 ]
460 )) ?>"
461 style="background: var(--fluent-cart-primary-color, #253241);font-size:14px;color:#000;background: none;font-weight: 600;display:inline-block;">
462 <?php echo esc_html__('Download Receipt', 'fluent-cart'); ?>
463 </a>
464 </div>
465
466 <?php do_action('fluent_cart/after_receipt', [
467 'order' => $order,
468 'is_first_time' => $is_first_time ?? false,
469 'order_operation' => $order_operation ?? null
470 ]);
471 ?>
472
473 <?php
474 if (!empty($is_first_time)) {
475 do_action('fluent_cart/after_receipt_first_time', [
476 'order' => $order,
477 'order_operation' => $order_operation ?? null
478 ]);
479 }
480 ?>
481