| 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->getPrimaryOrderTaxRate(); |
| 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(!empty($item['variation_display_title']) ? $item['variation_display_title'] : $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 |
| 186 |
$prorateCredit = (int) \FluentCart\Framework\Support\Arr::get($order->config, 'prorate_credit', 0); |
| 187 |
$upgradeDiscount = $order->manual_discount_total - $prorateCredit; |
| 188 |
// When the prorate credit IS the whole discount, label the row directly |
| 189 |
// instead of showing "Discount" with a single redundant breakdown row. |
| 190 |
$onlyProrateCredit = $prorateCredit > 0 && $upgradeDiscount <= 0 && $order->coupon_discount_total <= 0; |
| 191 |
?> |
| 192 |
<?php if ($order->manual_discount_total + $order->coupon_discount_total > 0): ?> |
| 193 |
<div |
| 194 |
style="display: flex;align-items: center; justify-content: space-between;"> |
| 195 |
<div |
| 196 |
style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| 197 |
<?php echo $onlyProrateCredit ? esc_html__('Prorate Credit', 'fluent-cart') : esc_html__('Discount', 'fluent-cart'); ?> |
| 198 |
</div> |
| 199 |
<div |
| 200 |
style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right"> |
| 201 |
- <?php echo esc_html(Helper::toDecimal($order->manual_discount_total + $order->coupon_discount_total)); ?> |
| 202 |
</div> |
| 203 |
</div> |
| 204 |
<?php if ($prorateCredit > 0 && $upgradeDiscount > 0): ?> |
| 205 |
<div style="display: flex;align-items: center; justify-content: space-between; padding-left: 12px;"> |
| 206 |
<div style="font-size:12px;color:rgb(107,114,128);line-height:20px;margin: 0;"> |
| 207 |
<?php echo esc_html__('Upgrade Discount', 'fluent-cart'); ?> |
| 208 |
</div> |
| 209 |
<div style="font-size:12px;color:rgb(107,114,128);margin:0;line-height:20px;text-align: right"> |
| 210 |
<?php echo esc_html(Helper::toDecimal($upgradeDiscount)); ?> |
| 211 |
</div> |
| 212 |
</div> |
| 213 |
<?php endif; ?> |
| 214 |
<?php if ($prorateCredit > 0 && !$onlyProrateCredit): ?> |
| 215 |
<div style="display: flex;align-items: center; justify-content: space-between; padding-left: 12px;"> |
| 216 |
<div style="font-size:12px;color:rgb(107,114,128);line-height:20px;margin: 0;"> |
| 217 |
<?php echo esc_html__('Prorate Credit', 'fluent-cart'); ?> |
| 218 |
</div> |
| 219 |
<div style="font-size:12px;color:rgb(107,114,128);margin:0;line-height:20px;text-align: right"> |
| 220 |
<?php echo esc_html(Helper::toDecimal($prorateCredit)); ?> |
| 221 |
</div> |
| 222 |
</div> |
| 223 |
<?php endif; ?> |
| 224 |
<?php endif; ?> |
| 225 |
<?php if ($order->shipping_total > 0): ?> |
| 226 |
<div |
| 227 |
style="display: flex;align-items: center; justify-content: space-between;"> |
| 228 |
<div |
| 229 |
style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| 230 |
<?php echo esc_html__('Shipping', 'fluent-cart'); ?> |
| 231 |
</div> |
| 232 |
<div |
| 233 |
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> |
| 234 |
</div> |
| 235 |
<?php endif; ?> |
| 236 |
<?php |
| 237 |
$feeItems = $order->feeItems()->get(); |
| 238 |
foreach ($feeItems as $feeItem): ?> |
| 239 |
<div |
| 240 |
style="display: flex;align-items: center; justify-content: space-between;"> |
| 241 |
<div |
| 242 |
style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| 243 |
<?php echo esc_html($feeItem->title); ?> |
| 244 |
</div> |
| 245 |
<div |
| 246 |
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> |
| 247 |
</div> |
| 248 |
<?php endforeach; ?> |
| 249 |
<?php if ($order->isReverseChargeTaxOrder()): ?> |
| 250 |
<?php |
| 251 |
$rcReversedTotal = $order->getReversedTaxTotal(); |
| 252 |
$rcChargeLabel = $rcReversedTotal > 0 |
| 253 |
? sprintf( |
| 254 |
/* translators: %1$s: formatted reversed tax amount */ |
| 255 |
__('Tax reversed: %1$s', 'fluent-cart'), |
| 256 |
Helper::toDecimal($rcReversedTotal) |
| 257 |
) |
| 258 |
: __('Charge reversed', 'fluent-cart'); |
| 259 |
?> |
| 260 |
<div |
| 261 |
style="display: flex;align-items: center; justify-content: space-between;"> |
| 262 |
<div |
| 263 |
style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| 264 |
<?php echo esc_html__('Tax', 'fluent-cart'); ?> |
| 265 |
</div> |
| 266 |
<div |
| 267 |
style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right"> |
| 268 |
<?php echo esc_html($rcChargeLabel); ?> |
| 269 |
</div> |
| 270 |
</div> |
| 271 |
<?php elseif ($order->tax_total > 0): ?> |
| 272 |
<div |
| 273 |
style="display: flex;align-items: center; justify-content: space-between;"> |
| 274 |
<div |
| 275 |
style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| 276 |
<?php echo esc_html__('Total Tax', 'fluent-cart'); ?> |
| 277 |
<?php echo \FluentCart\App\Helpers\Helper::getOrderTaxLabel($order); ?> |
| 278 |
</div> |
| 279 |
<div |
| 280 |
style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right"> |
| 281 |
<?php echo esc_html(Helper::toDecimal($order->tax_total)); ?> |
| 282 |
</div> |
| 283 |
</div> |
| 284 |
<?php endif; ?> |
| 285 |
<?php if ($order->shipping_tax > 0): ?> |
| 286 |
<div |
| 287 |
style="display: flex;align-items: center; justify-content: space-between;"> |
| 288 |
<div |
| 289 |
style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| 290 |
<?php echo esc_html__('Shipping Tax', 'fluent-cart'); ?> |
| 291 |
<?php echo \FluentCart\App\Helpers\Helper::getOrderTaxLabel($order); ?> |
| 292 |
</div> |
| 293 |
<div |
| 294 |
style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right"> |
| 295 |
<?php echo esc_html(Helper::toDecimal($order->shipping_tax)); ?> |
| 296 |
</div> |
| 297 |
</div> |
| 298 |
<?php endif; ?> |
| 299 |
|
| 300 |
<?php if ($order->total_refund > 0): ?> |
| 301 |
<div |
| 302 |
style="display: flex;align-items: center; justify-content: space-between;"> |
| 303 |
<div |
| 304 |
style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| 305 |
<?php echo esc_html__('Refund', 'fluent-cart'); ?> |
| 306 |
</div> |
| 307 |
<div |
| 308 |
style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right"> |
| 309 |
- <?php echo esc_html(Helper::toDecimal($order->total_refund)); ?> |
| 310 |
</div> |
| 311 |
</div> |
| 312 |
<?php endif; ?> |
| 313 |
<div |
| 314 |
style="display: flex;align-items: center; justify-content: space-between;"> |
| 315 |
<div |
| 316 |
style="font-size:16px;font-weight:700;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| 317 |
<?php echo esc_html__('Total', 'fluent-cart'); ?> |
| 318 |
</div> |
| 319 |
<div |
| 320 |
style="text-transform:uppercase;font-size:14px;font-weight:700;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right"> |
| 321 |
<?php echo esc_html(Helper::toDecimal($order->total_amount - $order->total_refund)); ?> |
| 322 |
</div> |
| 323 |
</div> |
| 324 |
<div |
| 325 |
style="display: flex;align-items: center; justify-content: space-between;"> |
| 326 |
<div |
| 327 |
style="font-size:14px;color:rgb(55,65,81);line-height:24px;margin: 0;"> |
| 328 |
<?php echo esc_html__('Payment Method', 'fluent-cart'); ?> |
| 329 |
</div> |
| 330 |
<div |
| 331 |
style="text-transform:uppercase;font-size:13px;color:rgb(55,65,81);margin:0;line-height:24px;text-align: right"> |
| 332 |
<?php if ($transaction->card_last_4) : |
| 333 |
echo esc_html($transaction->card_brand) . ' ' . esc_html($transaction->card_last_4); |
| 334 |
else: |
| 335 |
echo esc_html($transaction->payment_method); |
| 336 |
endif; ?> |
| 337 |
</div> |
| 338 |
</div> |
| 339 |
</div> |
| 340 |
|
| 341 |
<!-- tax note --> |
| 342 |
<?php |
| 343 |
if($order->isReverseChargeTaxOrder()): ?> |
| 344 |
|
| 345 |
<div style="text-align: right; font-size: 14px; margin-top: 10px;"> |
| 346 |
<?php echo '*' . esc_html__('Tax to be paid on reverse charge basis', 'fluent-cart'); ?> |
| 347 |
</div> |
| 348 |
|
| 349 |
<?php endif ?> |
| 350 |
|
| 351 |
|
| 352 |
</div> |
| 353 |
</div> |
| 354 |
<?php endif; ?> |
| 355 |
|
| 356 |
<?php |
| 357 |
|
| 358 |
App::make('view')->render('invoice.parts.subscription_items', [ |
| 359 |
'subscriptions' => $order->subscriptions, |
| 360 |
'order' => $order |
| 361 |
]) |
| 362 |
?> |
| 363 |
|
| 364 |
<?php |
| 365 |
$downloads = $order->getDownloads(); |
| 366 |
$licenses = $order->getLicenses(); |
| 367 |
if ($downloads) { |
| 368 |
\FluentCart\App\App::make('view')->render('emails.parts.downloads', [ |
| 369 |
'order' => $order, |
| 370 |
'heading' => 'Downloads', |
| 371 |
'downloadItems' => $downloads ?: [], |
| 372 |
'show_notice' => false |
| 373 |
]); |
| 374 |
} |
| 375 |
|
| 376 |
if ($licenses && $licenses->count() > 0) { |
| 377 |
\FluentCart\App\App::make('view')->render('emails.parts.licenses', [ |
| 378 |
'licenses' => $licenses, |
| 379 |
'heading' => 'Licenses', |
| 380 |
'show_notice' => false |
| 381 |
]); |
| 382 |
} |
| 383 |
?> |
| 384 |
|
| 385 |
<?php if ($order->fulfillment_type === 'physical') : ?> |
| 386 |
<div |
| 387 |
class="fct-thank-you-page-order-items-addresses" |
| 388 |
style="display: grid;grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));gap: 20px;margin-top: 20px;"> |
| 389 |
|
| 390 |
<div class="fct-thank-you-page-order-items-addresses-bill-to" style="font-size:14px;border-radius: 5px;"> |
| 391 |
<h5 style="font-weight: bold;font-size: 14px;margin: 0 0 10px 0;color: #495057;border-bottom: 1px solid #dee2e6;padding-bottom: 5px;"> |
| 392 |
<?php echo esc_html__('Bill To', 'fluent-cart'); ?> |
| 393 |
</h5> |
| 394 |
<?php |
| 395 |
if (!empty($order->billing_address)) : |
| 396 |
?> |
| 397 |
<div |
| 398 |
class="fct-thank-you-page-order-items-addresses-bill-to-address" |
| 399 |
style="margin-bottom: 3px;"> |
| 400 |
<?php echo esc_html($order->billing_address->getAddressAsText()); ?> |
| 401 |
</div> |
| 402 |
|
| 403 |
<div |
| 404 |
class="fct-thank-you-page-order-items-addresses-bill-to-email" |
| 405 |
style="margin-top: 10px;"> |
| 406 |
<?php echo esc_html($order->customer->email); ?> |
| 407 |
</div> |
| 408 |
<?php else: ?> |
| 409 |
<div |
| 410 |
class="fct-thank-you-page-order-items-addresses-bill-to-name" |
| 411 |
style="margin-top: 10px;"> |
| 412 |
<?php echo esc_html($order->customer->full_name); ?> |
| 413 |
</div> |
| 414 |
<div |
| 415 |
class="fct-thank-you-page-order-items-addresses-bill-to-email" |
| 416 |
style="margin-top: 3px;"> |
| 417 |
<?php echo esc_html($order->customer->email); ?> |
| 418 |
</div> |
| 419 |
<?php endif; ?> |
| 420 |
<?php |
| 421 |
$phoneNumber = Arr::get($order->billing_address->meta ?? [], 'other_data.phone', ''); |
| 422 |
if ($phoneNumber !== ''): |
| 423 |
?> |
| 424 |
<div class="fct-thank-you-page-order-items-addresses-bill-to-phone"> |
| 425 |
<?php echo esc_html($phoneNumber); ?> |
| 426 |
</div> |
| 427 |
<?php endif; ?> |
| 428 |
<div class="fct-thank-you-page-order-items-addresses-bill-to-company-name"> |
| 429 |
<?php |
| 430 |
$companyName = Arr::get($order->billing_address->meta ?? [], 'other_data.company_name', ''); |
| 431 |
|
| 432 |
if ($companyName === '') { |
| 433 |
$companyName = $order->getCustomerTaxName(); |
| 434 |
} |
| 435 |
echo esc_html($companyName); |
| 436 |
?> |
| 437 |
</div> |
| 438 |
<div class="fct-thank-you-page-order-items-addresses-bill-to-vat-number"> |
| 439 |
<?php |
| 440 |
$vatNumber = $order->getCustomerTaxNumber(); |
| 441 |
if ($vatNumber !== '') { |
| 442 |
$vatLabel = __('VAT/Tax ID', 'fluent-cart'); |
| 443 |
echo esc_html($vatLabel) . ': ' . esc_html($vatNumber); |
| 444 |
} |
| 445 |
?> |
| 446 |
</div> |
| 447 |
<?php |
| 448 |
$reverseChargeDeclaration = Arr::get($order->getBusinessInfo(), 'reverse_charge_declaration', ''); |
| 449 |
if ($reverseChargeDeclaration !== ''): |
| 450 |
?> |
| 451 |
<div class="fct-thank-you-page-order-items-addresses-bill-to-vat-number"> |
| 452 |
<strong><?php echo esc_html__('Reverse Charge Declaration', 'fluent-cart'); ?>:</strong> |
| 453 |
<?php echo esc_html($reverseChargeDeclaration); ?> |
| 454 |
</div> |
| 455 |
<?php endif; ?> |
| 456 |
</div> |
| 457 |
<div |
| 458 |
class="fct-thank-you-page-order-items-addresses-ship-to" |
| 459 |
style="font-size:14px;border-radius: 5px;"> |
| 460 |
<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;"> |
| 461 |
<?php echo esc_html__('Ship To', 'fluent-cart'); ?> |
| 462 |
</h5> |
| 463 |
<?php if (!empty($order->shipping_address)) : ?> |
| 464 |
<div |
| 465 |
class="fct-thank-you-page-order-items-addresses-ship-to-address" |
| 466 |
style="margin-bottom: 3px;"> |
| 467 |
<?php echo esc_html($order->shipping_address->getAddressAsText()); ?> |
| 468 |
</div> |
| 469 |
<!-- show phone number --> |
| 470 |
<?php |
| 471 |
$phone = Arr::get($order->shipping_address->meta ?? [], 'other_data.phone', ''); |
| 472 |
if ($phone !== ''):?> |
| 473 |
<div class="fct-thank-you-page-order-items-addresses-ship-to-phone"> |
| 474 |
<?php echo esc_html($phone); ?> |
| 475 |
</div> |
| 476 |
<?php endif; ?> |
| 477 |
<?php else: ?> |
| 478 |
<div |
| 479 |
class="fct-thank-you-page-order-items-addresses-ship-to-name" |
| 480 |
style="margin-top: 10px;"> |
| 481 |
<?php echo esc_html($order->customer->full_name); ?> |
| 482 |
</div> |
| 483 |
<div |
| 484 |
class="fct-thank-you-page-order-items-addresses-ship-to-email" |
| 485 |
style="margin-top: 3px;"> |
| 486 |
<?php echo esc_html($order->customer->email); ?> |
| 487 |
</div> |
| 488 |
<?php endif; ?> |
| 489 |
</div> |
| 490 |
</div> |
| 491 |
<?php endif; ?> |
| 492 |
|
| 493 |
</div> |
| 494 |
</div> |
| 495 |
</div> |
| 496 |
</div> |
| 497 |
|
| 498 |
</div> |
| 499 |
<?php |
| 500 |
// include(__DIR__ . '/../emails/components/cta.php') |
| 501 |
?> |
| 502 |
</div> |
| 503 |
</div> |
| 504 |
|
| 505 |
<div style="text-align: center;margin-top: 10px;display: flex;align-items: center;justify-content: center;gap: 10px;"> |
| 506 |
<a href="<?php echo esc_url($profilePage . 'order/' . $order->uuid); ?>" |
| 507 |
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;"> |
| 508 |
<?php echo esc_html__('View Order', 'fluent-cart'); ?> |
| 509 |
</a> |
| 510 |
<a href="<?php echo esc_url(\FluentCart\App\Services\URL::appendQueryParams( |
| 511 |
home_url(), |
| 512 |
[ |
| 513 |
'fluent-cart' => 'receipt', |
| 514 |
'order_hash' => esc_attr($order->uuid), |
| 515 |
'download' => 1 |
| 516 |
] |
| 517 |
)) ?>" |
| 518 |
style="background: var(--fluent-cart-primary-color, #253241);font-size:14px;color:#000;background: none;font-weight: 600;display:inline-block;"> |
| 519 |
<?php echo esc_html__('Download Receipt', 'fluent-cart'); ?> |
| 520 |
</a> |
| 521 |
</div> |
| 522 |
|
| 523 |
<?php do_action('fluent_cart/after_receipt', [ |
| 524 |
'order' => $order, |
| 525 |
'is_first_time' => $is_first_time ?? false, |
| 526 |
'order_operation' => $order_operation ?? null |
| 527 |
]); |
| 528 |
?> |
| 529 |
|
| 530 |
<?php |
| 531 |
if (!empty($is_first_time)) { |
| 532 |
do_action('fluent_cart/after_receipt_first_time', [ |
| 533 |
'order' => $order, |
| 534 |
'order_operation' => $order_operation ?? null |
| 535 |
]); |
| 536 |
} |
| 537 |
?> |
| 538 |
|