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