add-to-cart-edd.php
4 years ago
add-to-cart-woocommerce.php
4 years ago
course-author.php
4 years ago
course-continue.php
4 years ago
course-in-cart.php
4 years ago
course-price-edd.php
4 years ago
course-price-woocommerce.php
4 years ago
course-price.php
4 years ago
course.php
4 years ago
end_content_wrap.php
5 years ago
enrolled-course-progress.php
4 years ago
footer.php
4 years ago
header.php
4 years ago
loop-after-content.php
4 years ago
loop-before-content.php
4 years ago
loop-end.php
5 years ago
loop-start.php
4 years ago
meta.php
4 years ago
rating.php
4 years ago
start_content_wrap.php
4 years ago
thumbnail.php
4 years ago
title.php
4 years ago
course-price.php
72 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Course loop price |
| 5 | * |
| 6 | * @since v.1.0.0 |
| 7 | * @author themeum |
| 8 | * @url https://themeum.com |
| 9 | * |
| 10 | * @package TutorLMS/Templates |
| 11 | * @version 1.4.3 |
| 12 | */ |
| 13 | ?> |
| 14 | <?php |
| 15 | $course_id = get_the_ID(); |
| 16 | $enroll_btn = '<div class="tutor-course-list-btn">' . apply_filters( 'tutor_course_restrict_new_entry', '<a href="'. get_the_permalink(). '" class="tutor-btn tutor-btn-outline-primary tutor-btn-md tutor-btn-block">' . __('Enroll Course', 'tutor') . '</a>' ) . '</div>'; |
| 17 | $free_html = $enroll_btn; |
| 18 | if (tutor_utils()->is_course_purchasable()) { |
| 19 | $enroll_btn = tutor_course_loop_add_to_cart(false); |
| 20 | |
| 21 | $product_id = tutor_utils()->get_course_product_id($course_id); |
| 22 | $product = wc_get_product( $product_id ); |
| 23 | |
| 24 | $total_enrolled = tutor_utils()->count_enrolled_users_by_course($course_id); |
| 25 | $maximum_students = tutor_utils()->get_course_settings($course_id, 'maximum_students'); |
| 26 | |
| 27 | if ($maximum_students != 0 && $total_enrolled != $maximum_students) { |
| 28 | $total_booked = 100 / $maximum_students * $total_enrolled; |
| 29 | $b_total = $total_booked; |
| 30 | |
| 31 | echo '<div class="tutor-d-flex tutor-align-center tutor-justify-between"> |
| 32 | <div> |
| 33 | <span class="tutor-course-price tutor-fs-6 tutor-fw-bold tutor-color-black">'. |
| 34 | $product->get_price_html() . ' |
| 35 | </span> |
| 36 | </div> |
| 37 | |
| 38 | <div class="tutor-course-booking-progress tutor-d-flex tutor-align-center"> |
| 39 | <div class="tutor-mr-8"> |
| 40 | <div class="tutor-progress-circle" style="--pro: ' . $b_total . '%;" area-hidden="true"></div> |
| 41 | </div> |
| 42 | <div class="tutor-fs-7 tutor-fw-medium tutor-color-black">'. |
| 43 | $b_total . __('% Booked', 'tutor') . ' |
| 44 | </div> |
| 45 | </div> |
| 46 | </div> |
| 47 | <div class="tutor-course-booking-availability tutor-mt-16"> |
| 48 | <button class="tutor-btn tutor-btn-outline-primary tutor-btn-md tutor-btn-block">'. |
| 49 | apply_filters( 'tutor_course_restrict_new_entry', $enroll_btn ) . ' |
| 50 | </button> |
| 51 | </div>'; |
| 52 | } |
| 53 | |
| 54 | if ( $product && $maximum_students == $total_enrolled && $maximum_students != 0) { |
| 55 | $price_html = '<div class="tutor-d-flex tutor-align-center tutor-justify-between"><div class="list-item-price tutor-d-flex tutor-align-center"> <span class="price tutor-fs-6 tutor-fw-bold tutor-color-black">'.$product->get_price_html() . ' </span></div>'; |
| 56 | $restrict = '<div class="list-item-booking booking-full tutor-d-flex tutor-align-center"><div class="booking-progress tutor-d-flex"><span class="tutor-mr-8 tutor-color-warning tutor-icon-circle-info"></span></div><div class="tutor-fs-7 tutor-fw-medium tutor-color-black">'. __('Fully Booked', 'tutor') .'</div></div></div>'; |
| 57 | echo wp_kses_post($price_html); |
| 58 | echo wp_kses_post($restrict); |
| 59 | } |
| 60 | |
| 61 | if ( $product && $maximum_students == 0) { |
| 62 | $price_html = '<div class="tutor-d-flex tutor-align-center tutor-justify-between"><div class="list-item-price tutor-d-flex tutor-align-center"> <span class="price tutor-fs-6 tutor-fw-bold tutor-color-black">'.$product->get_price_html() . ' </span></div>'; |
| 63 | $cart_html = '<div class="list-item-button"> '.apply_filters( 'tutor_course_restrict_new_entry', $enroll_btn ) . ' </div></div>'; |
| 64 | echo wp_kses_post($price_html); |
| 65 | echo wp_kses_post($cart_html); |
| 66 | } |
| 67 | |
| 68 | } else { |
| 69 | echo wp_kses_post($free_html); |
| 70 | } |
| 71 | ?> |
| 72 |