-
Notifications
You must be signed in to change notification settings - Fork 134
/
my-orders.php
93 lines (86 loc) · 2.83 KB
/
my-orders.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
* Order History List
*
* @package LifterLMS/Templates
*
* @since 3.0.0
* @version 7.6.0
*/
defined( 'ABSPATH' ) || exit;
?>
<div class="llms-sd-section llms-my-orders">
<?php if ( ! $orders || ! $orders['orders'] ) : ?>
<p><?php esc_html_e( 'No orders found.', 'lifterlms' ); ?></p>
<?php else : ?>
<table class="orders-table">
<thead>
<tr>
<td><?php esc_html_e( 'Order', 'lifterlms' ); ?></td>
<td><?php esc_html_e( 'Date', 'lifterlms' ); ?></td>
<td><?php esc_html_e( 'Expires', 'lifterlms' ); ?></td>
<td><?php esc_html_e( 'Next Payment', 'lifterlms' ); ?></td>
<td></td>
</tr>
</thead>
<tbody>
<?php foreach ( $orders['orders'] as $order ) : ?>
<tr class="llms-order-item <?php echo esc_attr( $order->get( 'status' ) ); ?>" id="llms-order-<?php esc_attr( $order->get( 'id' ) ); ?>">
<td data-label="<?php esc_attr_e( 'Order', 'lifterlms' ); ?>: ">
<a href="<?php echo esc_url( $order->get_view_link() ); ?>">#<?php echo esc_html( $order->get( 'id' ) ); ?></a>
<span class="llms-status <?php echo esc_attr( $order->get( 'status' ) ); ?>"><?php echo esc_html( $order->get_status_name() ); ?></span>
</td>
<td data-label="<?php esc_attr_e( 'Date', 'lifterlms' ); ?>: "><?php echo esc_html( $order->get_date( 'date', 'F j, Y' ) ); ?></td>
<td data-label="<?php esc_attr_e( 'Expires', 'lifterlms' ); ?>: ">
<?php if ( $order->is_recurring() && 'lifetime' === $order->get( 'access_expiration' ) ) : ?>
–
<?php else : ?>
<?php echo esc_html( $order->get_access_expiration_date( 'F j, Y' ) ); ?>
<?php endif; ?>
</td>
<td data-label="<?php esc_attr_e( 'Next Payment', 'lifterlms' ); ?>: ">
<?php if ( $order->has_scheduled_payment() ) : ?>
<?php echo esc_html( $order->get_next_payment_due_date( 'F j, Y' ) ); ?>
<?php else : ?>
–
<?php endif; ?>
</td>
<td>
<a class="llms-button-primary small" href="<?php echo esc_url( $order->get_view_link() ); ?>"><?php esc_html_e( 'View', 'lifterlms' ); ?></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php if ( $orders['orders'] ) : ?>
<footer class="llms-sd-pagination llms-my-orders-pagination">
<?php if ( $orders['page'] > 1 ) : ?>
<a href="
<?php
echo esc_url(
add_query_arg(
array(
'opage' => $orders['page'] - 1,
)
)
);
?>
"><?php esc_html_e( 'Back', 'lifterlms' ); ?></a>
<?php endif; ?>
<?php if ( $orders['page'] < $orders['pages'] ) : ?>
<a href="
<?php
echo esc_url(
add_query_arg(
array(
'opage' => $orders['page'] + 1,
)
)
);
?>
"><?php esc_html_e( 'Next', 'lifterlms' ); ?></a>
<?php endif; ?>
</footer>
<?php endif; ?>
<?php endif; ?>
</div>