| 1 |
<?php |
| 2 |
|
| 3 |
defined( 'ABSPATH' ) || exit; |
| 4 |
|
| 5 |
if (!$order->items) { |
| 6 |
return ''; |
| 7 |
} |
| 8 |
|
| 9 |
?> |
| 10 |
<table class="table fluent_booking_order_items_table fluent_booking_table table_bordered"> |
| 11 |
<thead> |
| 12 |
<th><?php esc_html_e('Item', 'fluent-booking'); ?></th> |
| 13 |
<th><?php esc_html_e('Quantity', 'fluent-booking'); ?></th> |
| 14 |
<th><?php esc_html_e('Price', 'fluent-booking'); ?></th> |
| 15 |
<th><?php esc_html_e('Line Total', 'fluent-booking'); ?></th> |
| 16 |
</thead> |
| 17 |
<tbody> |
| 18 |
<?php $fluentBookingSubTotal = 0; ?> |
| 19 |
<?php foreach ($order->items->toArray() as $fluentBookingOrderItem) { |
| 20 |
if (is_array($fluentBookingOrderItem)) { |
| 21 |
if (!empty($fluentBookingOrderItem['item_total'])) :?> |
| 22 |
<tr> |
| 23 |
<td><?php echo esc_html($fluentBookingOrderItem['item_name']); ?></td> |
| 24 |
<td><?php echo esc_html($fluentBookingOrderItem['quantity']); ?></td> |
| 25 |
<td><?php echo esc_attr(fluentbookingFormattedAmount($fluentBookingOrderItem['item_price'], $currency_settings)); ?></td> |
| 26 |
<td><?php echo esc_attr(fluentbookingFormattedAmount($fluentBookingOrderItem['item_total'], $currency_settings)); ?></td> |
| 27 |
</tr> |
| 28 |
<?php |
| 29 |
$fluentBookingSubTotal += $fluentBookingOrderItem['item_total']; |
| 30 |
endif; |
| 31 |
} else { |
| 32 |
if (isset($fluentBookingOrderItem->item_total) && $fluentBookingOrderItem->item_total) :?> |
| 33 |
<tr> |
| 34 |
<td><?php echo esc_html($fluentBookingOrderItem->item_name); ?></td> |
| 35 |
<td><?php echo esc_html($fluentBookingOrderItem->quantity); ?></td> |
| 36 |
<td><?php echo esc_html(fluentbookingFormattedAmount($fluentBookingOrderItem->item_price, $currency_settings)); ?></td> |
| 37 |
<td><?php echo esc_html(fluentbookingFormattedAmount($fluentBookingOrderItem->item_total, $currency_settings)); ?></td> |
| 38 |
</tr> |
| 39 |
<?php |
| 40 |
$fluentBookingSubTotal += $fluentBookingOrderItem->item_total; |
| 41 |
endif; |
| 42 |
} |
| 43 |
|
| 44 |
}; |
| 45 |
?> |
| 46 |
</tbody> |
| 47 |
<tfoot> |
| 48 |
<?php $fluentBookingDiscountTotal = 0; |
| 49 |
if (isset($order->discounts) && count($order->discounts)) : ?> |
| 50 |
<tr class="fluent_booking_total_row"> |
| 51 |
<th style="text-align: right" colspan="3"><?php esc_html_e('Sub-Total', 'fluent-booking'); ?></th> |
| 52 |
<td><?php echo esc_html(fluentbookingFormattedAmount($fluentBookingSubTotal, $currency_settings)); ?></td> |
| 53 |
</tr> |
| 54 |
<?php |
| 55 |
foreach ($order->discounts as $fluentBookingDiscount) : |
| 56 |
$fluentBookingDiscountTotal += $fluentBookingDiscount->item_total; |
| 57 |
?> |
| 58 |
<tr class="fluent_booking_discount_row"> |
| 59 |
<?php /* translators: %s: Discount name */ ?> |
| 60 |
<th style="text-align: right" colspan="3"><?php printf(esc_html__('Discounts(%s)', 'fluent-booking'), esc_html($fluentBookingDiscount->item_name)); ?></th> |
| 61 |
<td><?php echo '-' . esc_html(fluentbookingFormattedAmount($fluentBookingDiscount->item_total, $currency_settings)); ?></td> |
| 62 |
</tr> |
| 63 |
<?php endforeach; ?> |
| 64 |
<?php endif; ?> |
| 65 |
<tr class="fluent_booking_total_payment_row"> |
| 66 |
<th style="text-align: right" colspan="3"><?php esc_html_e('Total', 'fluent-booking'); ?></th> |
| 67 |
<td> |
| 68 |
<?php if (isset($hasSubscription) && $hasSubscription) : ?> |
| 69 |
<?php echo esc_attr(fluentbookingFormattedAmount($order->total_amount, $currency_settings)); ?> |
| 70 |
<?php else: ?> |
| 71 |
<?php echo esc_attr(fluentbookingFormattedAmount($order->total_amount, $currency_settings)); ?> |
| 72 |
<?php endif; ?> |
| 73 |
</td> |
| 74 |
</tr> |
| 75 |
</tfoot> |
| 76 |
</table> |
| 77 |
|