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