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.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / dashboard / account / billing / order-history.php
tutor / templates / dashboard / account / billing Last commit date
edd-order-history-card.php 6 days ago native-order-history-card.php 6 days ago order-history.php 6 days ago wc-order-history-card.php 6 days ago
order-history.php
117 lines
1 <?php
2 /**
3 * Order History Template for Billing
4 *
5 * @package Tutor\Templates
6 * @subpackage Dashboard
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @since 4.0.0
10 *
11 * These variables are inherited from parent template.
12 * template: tutor/templates/dashboard/account/billing.php
13 *
14 * @var int $user_id The user ID.
15 * @var int $offset The offset for pagination.
16 * @var int $item_per_page The number of items per page.
17 * @var string $order_filter The order filter.
18 * @var int $current_page The current page.
19 */
20
21 defined( 'ABSPATH' ) || exit;
22
23 use Tutor\Components\Button;
24 use Tutor\Components\Constants\Size;
25 use Tutor\Components\Constants\Variant;
26 use Tutor\Components\DateFilter;
27 use Tutor\Components\DropdownFilter;
28 use Tutor\Components\EmptyState;
29 use Tutor\Components\Pagination;
30 use Tutor\Components\Sorting;
31 use TUTOR\Dashboard;
32 use Tutor\Ecommerce\Ecommerce;
33 use TUTOR\Input;
34
35 $monetize_by = tutor_utils()->get_option( 'monetize_by' );
36 if ( 'free' === $monetize_by ) {
37 EmptyState::make()->title( __( 'No Orders Found!', 'tutor' ) )->render();
38 return;
39 }
40
41 $start_date = Input::get( 'start_date' );
42 $end_date = Input::get( 'end_date' );
43 $selected_filter = Input::get( 'data', 'all' );
44
45 $args = array(
46 'status' => $selected_filter,
47 'start_date' => $start_date,
48 'end_date' => $end_date,
49 'limit' => $item_per_page,
50 'offset' => $offset,
51 'order' => $order_filter,
52 );
53
54 $response = tutor_utils()->get_orders_by_user_id( $user_id, $args );
55 $orders = $response->results ?? array();
56 $total_items = $response->total_count ?? 0;
57
58 $status_options = apply_filters( 'tutor_order_history_status_options', array(), $selected_filter );
59 ?>
60
61 <div class="tutor-flex tutor-items-center tutor-justify-between tutor-px-6 tutor-py-5 tutor-border-b">
62 <?php DropdownFilter::make()->options( $status_options )->render(); ?>
63 <div class="tutor-flex tutor-items-center tutor-gap-3">
64 <?php
65 $query_params = array( 'data', 'order', 'start_date', 'end_date' );
66 if ( Input::has_any( $query_params, Input::GET_REQUEST ) ) {
67 Button::make()
68 ->tag( 'a' )
69 ->size( Size::X_SMALL )
70 ->attr( 'href', Dashboard::get_account_page_url( 'billing' ) )
71 ->attr( 'class', 'tutor-text-brand' )
72 ->label( __( 'Clear all', 'tutor' ) )
73 ->variant( Variant::LINK )
74 ->render();
75 }
76
77 DateFilter::make()
78 ->type( DateFilter::TYPE_RANGE )
79 ->placement( DateFilter::PLACEMENT_BOTTOM_END )
80 ->trigger_size( Size::X_SMALL )
81 ->hide_initial_label()
82 ->render();
83
84 Sorting::make()->size( Size::X_SMALL )->order( $order_filter )->render();
85 ?>
86 </div>
87 </div>
88
89 <?php
90 if ( empty( $orders ) ) :
91 EmptyState::make()
92 ->title( 'No Orders Found!' )
93 ->icon( tutor_utils()->get_themed_svg( 'images/illustrations/order-empty.svg' ) )
94 ->render();
95 else :
96 ?>
97 <div class="tutor-flex tutor-flex-column tutor-order-history">
98 <?php
99 $default_card_template = Ecommerce::MONETIZE_BY === $monetize_by ? tutor_get_template( 'dashboard.account.billing.native-order-history-card' ) : '';
100 $order_history_card_template = apply_filters( 'tutor_order_history_card_template', $default_card_template );
101 foreach ( $orders as $order_data ) :
102 if ( file_exists( $order_history_card_template ) ) {
103 tutor_load_template_from_custom_path( $order_history_card_template, array( 'order_data' => $order_data ), false );
104 }
105 endforeach;
106 ?>
107 </div>
108
109 <?php
110 Pagination::make()
111 ->attr( 'class', 'tutor-px-6 tutor-py-6 tutor-border-t' )
112 ->current( $current_page )
113 ->total( $total_items )
114 ->limit( $item_per_page )
115 ->render();
116 endif;
117