| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for displaying orders dashboard in wp-admin |
| 4 |
* |
| 5 |
* @author ThimPress |
| 6 |
* @package LearnPress/Inc/Admin/Views/ |
| 7 |
* @version 4.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
defined( 'ABSPATH' ) || exit; |
| 11 |
|
| 12 |
if ( empty( $specific_statuses ) ) { |
| 13 |
return; |
| 14 |
} |
| 15 |
?> |
| 16 |
|
| 17 |
<li class="count-number total-raised"> |
| 18 |
<strong><?php echo learn_press_get_total_price_order_complete(); ?></strong> |
| 19 |
<p><?php esc_html_e( 'Total Raised', 'learnpress' ); ?></p> |
| 20 |
</li> |
| 21 |
|
| 22 |
<?php |
| 23 |
|
| 24 |
$counts = learn_press_count_orders( array( 'status' => $specific_statuses ) ); |
| 25 |
|
| 26 |
foreach ( $specific_statuses as $status ) : |
| 27 |
|
| 28 |
$status_object = get_post_status_object( $status ); |
| 29 |
|
| 30 |
if ( ! $status_object ) { |
| 31 |
continue; |
| 32 |
} |
| 33 |
|
| 34 |
$count = $counts[ $status ]; |
| 35 |
$url = $count ? admin_url( 'edit.php?post_type=' . LP_ORDER_CPT . '&post_status=' . $status ) : '#'; |
| 36 |
?> |
| 37 |
|
| 38 |
<li class="counter-number order-<?php echo str_replace( 'lp-', '', $status ); ?>"> |
| 39 |
<div class="counter-inner"> |
| 40 |
<a href="<?php echo esc_url_raw( $url ); ?>"> |
| 41 |
<strong> |
| 42 |
<?php |
| 43 |
if ( $count ) { |
| 44 |
printf( translate_nooped_plural( _n_noop( '%d order', '%d orders' ), $count, 'learnpress' ), $count ); |
| 45 |
} else { |
| 46 |
printf( __( '%d order', 'learnpress' ), 0 ); |
| 47 |
} |
| 48 |
?> |
| 49 |
</strong> |
| 50 |
<p><?php printf( '%s', $status_object->label ); ?></p> |
| 51 |
</a> |
| 52 |
</div> |
| 53 |
</li> |
| 54 |
<?php endforeach; ?> |
| 55 |
|