PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.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
← All changes | inc/admin/views/statistics/orders.php +108 -44 4.4.24.4.8 View file →
@@ -1,57 +1,121 @@
1 1 <?php
2 2 /**
3 - * Template for displaying orders statistics tab Orders statistics page.
3 + * Template for displaying the Orders statistics dashboard tab.
4 + *
5 + * Data is rendered by assets/src/js/admin/statistics/tab-orders.js from the
6 + * `dashboard` key of the order-statistics endpoint.
7 + *
8 + * @since 4.4.2
4 9 */
10 +
11 +defined( 'ABSPATH' ) || exit();
12 +
13 +$kpi_cards = array(
14 + 'net-sales' => __( 'Net sales', 'learnpress' ),
15 + 'completed-orders' => __( 'Completed orders', 'learnpress' ),
16 + 'processing' => __( 'Processing orders', 'learnpress' ),
17 + 'pending' => __( 'Pending orders', 'learnpress' ),
18 + 'cancelled-failed' => __( 'Cancelled / failed', 'learnpress' ),
19 + 'paid-courses-sold' => __( 'Paid courses sold', 'learnpress' ),
20 +);
21 +
22 +$payment_health = array(
23 + 'completed' => __( 'Completed', 'learnpress' ),
24 + 'processing' => __( 'Processing', 'learnpress' ),
25 + 'pending' => __( 'Pending', 'learnpress' ),
26 + 'cancelled' => __( 'Cancelled', 'learnpress' ),
27 + 'failed' => __( 'Failed', 'learnpress' ),
28 +);
29 +
30 +// Section config filters — add/remove/relabel cards and lists. @since 4.4.2
31 +$kpi_cards = (array) apply_filters( 'learn-press/statistics/orders/kpi-cards', $kpi_cards );
32 +$payment_health = (array) apply_filters( 'learn-press/statistics/orders/payment-health', $payment_health );
5 33 ?>
34 +<div class="lp-admin-statistics-tab-content lp-stats-tab-orders">
35 + <?php
36 + /**
37 + * Fires at the top of the Orders statistics tab, inside the tab container.
38 + *
39 + * @since 4.4.2
40 + */
41 + do_action( 'learn-press/statistics/orders/before' );
6 42
7 -<div class="lp-admin-statistics-tab-content">
8 - <div class="btn-group btn-group-filter">
9 - <button class="btn-filter-time active" type="button" data-filter="today" ><?php _e( 'Today', 'learnpress' ); ?></button>
10 - <!-- <button class="btn-filter-time" type="button" data-filter="yesterday" ><?php _e( 'Yesterday', 'learnpress' ); ?></button> -->
11 - <button class="btn-filter-time" type="button" data-filter="last7days" ><?php _e( 'Last 7 days', 'learnpress' ); ?></button>
12 - <button class="btn-filter-time" type="button" data-filter="last30days" ><?php _e( 'Last 30 days', 'learnpress' ); ?></button>
13 - <!-- <button class="btn-filter-time" type="button" data-filter="thismonth" ><?php _e( 'This month', 'learnpress' ); ?></button> -->
14 - <button class="btn-filter-time" type="button" data-filter="last12months"><?php _e( 'Last 12 months', 'learnpress' ); ?></button>
15 - <button class="btn-filter-time" type="button" data-filter="thisyear" ><?php _e( 'This year', 'learnpress' ); ?></button>
16 - <button class="btn-filter-time" type="button" data-filter="custom" ><?php _e( 'Custom', 'learnpress' ); ?></button>
17 - <div class="custom-filter-time">
18 - <input type="date" id="ct-filter-1" />
19 - <input type="date" id="ct-filter-2">
20 - <button class="custom-filter-btn button button-primary" type="button"><?php _e( 'Filter', 'learnpress' ); ?></button>
43 + learn_press_admin_view( 'statistics/parts/filter-bar' );
44 + ?>
45 +
46 + <div class="lp-stats-dashboard-body">
47 + <div class="lp-stats-kpi-grid">
48 + <?php
49 + foreach ( $kpi_cards as $key => $title ) {
50 + learn_press_admin_view(
51 + 'statistics/parts/kpi-card',
52 + array(
53 + 'key' => $key,
54 + 'title' => $title,
55 + )
56 + );
57 + }
58 + ?>
21 59 </div>
22 - </div>
23 - <div class="statistics-content">
24 - <input class="statistics-type" type="hidden" value="orders-statistics">
25 - <div class="statistics-group group-statistic-order">
26 - <div class="statistics-item">
27 - <span class="statistics-item-title"><?php _e( 'Total Orders', 'learnpress' ); ?></span>
28 - <span class="statistics-item-count total-order-count">0</span>
60 +
61 + <div class="lp-stats-overview-grid lp-stats-overview-grid--chart">
62 + <div class="lp-stats-section statistics-content">
63 + <div class="lp-stats-section__header">
64 + <div>
65 + <h3 class="lp-stats-section__title"><?php esc_html_e( 'Order volume and revenue', 'learnpress' ); ?></h3>
66 + <p class="lp-stats-section__description"><?php esc_html_e( 'Completed order revenue, order count, and status health for the selected period.', 'learnpress' ); ?></p>
67 + </div>
68 + </div>
69 + <div id="orders-chart" class="statistics-chart-wrapper">
70 + <?php lp_skeleton_animation_html( 10, 100 ); ?>
71 + <canvas id="orders-chart-content" style="display: none;"></canvas>
72 + </div>
29 73 </div>
30 - <div class="statistics-item">
31 - <span class="statistics-item-title"><?php _e( 'Completed Orders', 'learnpress' ); ?></span>
32 - <span class="statistics-item-count completed-order-count">0</span>
74 +
75 + <div class="lp-stats-section">
76 + <div class="lp-stats-section__header">
77 + <h3 class="lp-stats-section__title"><?php esc_html_e( 'Payment health', 'learnpress' ); ?></h3>
78 + </div>
79 + <ul class="lp-stats-payment-health">
80 + <?php foreach ( $payment_health as $status => $label ) : ?>
81 + <li class="lp-stats-payment-health__row" data-status="<?php echo esc_attr( $status ); ?>">
82 + <span class="lp-stats-payment-health__label"><?php echo esc_html( $label ); ?></span>
83 + <span class="lp-stats-payment-health__count">&ndash;</span>
84 + </li>
85 + <?php endforeach; ?>
86 + </ul>
33 87 </div>
34 - <div class="statistics-item">
35 - <span class="statistics-item-title"><?php _e( 'Proccessing Orders', 'learnpress' ); ?></span>
36 - <span class="statistics-item-count processing-order-count">0</span>
88 + </div>
89 +
90 + <div class="lp-stats-overview-grid lp-stats-overview-grid--tables">
91 + <div class="lp-stats-section">
92 + <div class="lp-stats-section__header">
93 + <h3 class="lp-stats-section__title"><?php esc_html_e( 'Top sold courses', 'learnpress' ); ?></h3>
94 + <button type="button" class="button-link lp-stats-section__action lp-stats-view-all-top-sold"><?php esc_html_e( 'Open report', 'learnpress' ); ?></button>
95 + </div>
96 + <?php lp_skeleton_animation_html( 5, 100 ); ?>
97 + <div class="lp-stats-table-top-sold-courses"></div>
37 98 </div>
38 - <div class="statistics-item">
39 - <span class="statistics-item-title"><?php _e( 'Pending Orders', 'learnpress' ); ?></span>
40 - <span class="statistics-item-count pending-order-count">0</span>
99 +
100 + <div class="lp-stats-section">
101 + <div class="lp-stats-section__header">
102 + <h3 class="lp-stats-section__title"><?php esc_html_e( 'Recent order exceptions', 'learnpress' ); ?></h3>
103 + <button type="button" class="button-link lp-stats-section__action lp-stats-view-all-exceptions"><?php esc_html_e( 'Open report', 'learnpress' ); ?></button>
104 + </div>
105 + <?php lp_skeleton_animation_html( 5, 100 ); ?>
106 + <div class="lp-stats-table-order-exceptions"></div>
41 107 </div>
42 - <div class="statistics-item">
43 - <span class="statistics-item-title"><?php _e( 'Cancelled Orders', 'learnpress' ); ?></span>
44 - <span class="statistics-item-count cancelled-order-count">0</span>
45 - </div>
46 - <div class="statistics-item">
47 - <span class="statistics-item-title"><?php _e( 'Fail Orders', 'learnpress' ); ?></span>
48 - <span class="statistics-item-count failed-order-count">0</span>
49 - </div>
50 108 </div>
51 - <h3 class="statistics-title"><?php _e( 'Completed Orders', 'learnpress' ); ?></h3>
52 - <div id="orders-chart" class="statistics-chart-wrapper">
53 - <?php lp_skeleton_animation_html( 10, 100 ); ?>
54 - <canvas id="orders-chart-content" style="display: none;"></canvas>
55 - </div>
56 109 </div>
110 +
111 + <?php
112 + learn_press_admin_view( 'statistics/parts/report-modal' );
113 +
114 + /**
115 + * Fires at the bottom of the Orders statistics tab, inside the tab container.
116 + *
117 + * @since 4.4.2
118 + */
119 + do_action( 'learn-press/statistics/orders/after' );
120 + ?>
57 121 </div>