earning
7 years ago
enrolled-courses
7 years ago
instructor
7 years ago
reviews
7 years ago
settings
7 years ago
withdraw-method-fields
7 years ago
dashboard.php
7 years ago
earning.php
7 years ago
enrolled-courses.php
7 years ago
index.php
7 years ago
logged-in.php
7 years ago
my-courses.php
7 years ago
my-profile.php
7 years ago
purchase_history.php
7 years ago
quiz-attempts.php
7 years ago
registration.php
7 years ago
reviews.php
7 years ago
settings.php
7 years ago
wishlist.php
7 years ago
withdraw.php
7 years ago
purchase_history.php
49 lines
| 1 | <h2>Purchase History</h2> |
| 2 | |
| 3 | <?php |
| 4 | $orders = tutor_utils()->get_orders_by_user_id(); |
| 5 | |
| 6 | if (tutor_utils()->count($orders)){ |
| 7 | ?> |
| 8 | <table> |
| 9 | <tr> |
| 10 | <th><?php _e('ID', 'tutor'); ?></th> |
| 11 | <th><?php _e('Courses', 'tutor'); ?></th> |
| 12 | <th><?php _e('Amount', 'tutor'); ?></th> |
| 13 | <th><?php _e('Status', 'tutor'); ?></th> |
| 14 | <th><?php _e('Date', 'tutor'); ?></th> |
| 15 | </tr> |
| 16 | <?php |
| 17 | foreach ($orders as $order){ |
| 18 | $wc_order = wc_get_order($order->ID); |
| 19 | ?> |
| 20 | <tr> |
| 21 | <td>#<?php echo $order->ID; ?></td> |
| 22 | <td> |
| 23 | <?php |
| 24 | $courses = tutor_utils()->get_course_enrolled_ids_by_order_id($order->ID); |
| 25 | if (tutor_utils()->count($courses)){ |
| 26 | foreach ($courses as $course){ |
| 27 | echo '<p>'.get_the_title($course['course_id']).'</p>'; |
| 28 | } |
| 29 | } |
| 30 | ?> |
| 31 | </td> |
| 32 | <td><?php echo tutor_utils()->tutor_price($wc_order->get_total()); ?></td> |
| 33 | <td><?php echo tutor_utils()->order_status_context($order->post_status); ?></td> |
| 34 | |
| 35 | <td> |
| 36 | <?php echo date_i18n(get_option('date_format'), strtotime($order->post_date)) ?> |
| 37 | </td> |
| 38 | </tr> |
| 39 | <?php |
| 40 | } |
| 41 | ?> |
| 42 | </table> |
| 43 | <?php |
| 44 | }else{ |
| 45 | echo _e('No purchase history available', 'tutor'); |
| 46 | } |
| 47 | |
| 48 | ?> |
| 49 |