PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.3.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.3.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / templates / profile / tabs / orders / list.php

list.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.3.8, at templates/profile/tabs/orders/list.php

79 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Template for displaying list orders in orders tab of user profile page.
4 *
5 * This template can be overridden by copying it to yourtheme/learnpress/orders/list.php.
6 *
7 * @author ThimPress
8 * @package Learnpress/Templates
9 * @version 4.0.1
10 */
11
12 use LearnPress\Helpers\Template;
13
14 defined( 'ABSPATH' ) || exit();
15
16 $profile = LP_Profile::instance();
17
18 $query_orders = $profile->query_orders( array( 'fields' => 'ids' ) );
19 if ( ! $query_orders->get_items() ) {
20 Template::print_message( __( 'No orders!', 'learnpress' ), 'info' );
21 return;
22 }
23 ?>
24
25 <h3 class="profile-heading"><?php esc_html_e( 'My Orders', 'learnpress' ); ?></h3>
26
27 <table class="lp-list-table profile-list-orders profile-list-table">
28 <thead>
29 <tr class="order-row">
30 <th class="column-order-number"><?php esc_html_e( 'Order', 'learnpress' ); ?></th>
31 <th class="column-order-total"><?php esc_html_e( 'Total', 'learnpress' ); ?></th>
32 <th class="column-order-status"><?php esc_html_e( 'Status', 'learnpress' ); ?></th>
33 <th class="column-order-date"><?php esc_html_e( 'Date', 'learnpress' ); ?></th>
34 <th class="column-order-actions"><?php esc_html_e( 'Actions', 'learnpress' ); ?></th>
35 </tr>
36 </thead>
37
38 <tbody>
39 <?php
40 foreach ( $query_orders->get_items() as $order_id ) {
41 $order = learn_press_get_order( $order_id );
42 ?>
43
44 <tr class="order-row">
45 <td class="column-order-number">
46 <a href="<?php echo esc_html( $order->get_view_order_url() ); ?>">
47 <?php echo esc_html( $order->get_order_number() ); ?>
48 </a>
49 </td>
50 <td class="column-order-total"><?php echo esc_html( $order->get_formatted_order_total() ); ?></td>
51 <td class="column-order-status">
52 <span class="lp-label label-<?php echo esc_attr( $order->get_status() ); ?>">
53 <?php echo wp_kses_post( $order->get_order_status_html() ); ?>
54 </span>
55 </td>
56 <td class="column-order-date"><?php echo esc_html( $order->get_order_date() ); ?></td>
57 <td class="column-order-actions">
58 <?php
59 $actions = $order->get_profile_order_actions();
60
61 if ( $actions ) {
62 foreach ( $actions as $action ) {
63 printf( '<a href="%s">%s</a>', esc_url_raw( $action['url'] ), $action['text'] );
64 }
65 }
66 ?>
67 </td>
68 </tr>
69 <?php } ?>
70 </tbody>
71
72 <tfoot>
73 <tr class="list-table-nav">
74 <td colspan="3" class="nav-text"><?php echo esc_html( $query_orders->get_offset_text() ); ?></td>
75 <td colspan="2" class="nav-pages"><?php $query_orders->get_nav_numbers( true ); ?></td>
76 </tr>
77 </tfoot>
78 </table>
79