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
tutor-pagination.php
4 years ago
tutor-pagination_ajax.php
4 years ago
course-price.php
59 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="list-item-button">' . apply_filters( 'tutor_course_restrict_new_entry', '<a href="'. get_the_permalink(). '" class="tutor-btn tutor-btn-disable-outline tutor-btn-outline-fd tutor-btn-md tutor-btn-full">' . __('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 | $price_html = '<div class="list-item-price-with-booking tutor-d-flex tutor-align-items-center tutor-justify-content-between"><div class="list-item-price tutor-d-flex tutor-align-items-center"> <span class="price tutor-fs-6 tutor-fw-bold tutor-color-black">'.$product->get_price_html() . ' </span></div>'; |
| 32 | $percet_html = '<div class="list-item-booking tutor-d-flex tutor-align-items-center"><div class="booking-progress tutor-d-flex"><div class="circle-progress progress-full" style="--pro:'.$b_total .'%;"></div></div><div class="tutor-fs-7 tutor-fw-medium tutor-color-black">'.$b_total . __('% Booked', 'tutor') . '</div></div></div>'; |
| 33 | $cart_html = '<div class="list-item-button tutor-mt-16 booking-available"><button class="tutor-btn tutor-btn-icon tutor-btn-disable-outline tutor-btn-md tutor-btn-full">'.apply_filters( 'tutor_course_restrict_new_entry', $enroll_btn ) . ' </button></div>'; |
| 34 | |
| 35 | echo wp_kses_post($price_html); |
| 36 | echo wp_kses_post($percet_html); |
| 37 | echo wp_kses_post($cart_html); |
| 38 | } |
| 39 | |
| 40 | if ( $product && $maximum_students == $total_enrolled && $maximum_students != 0) { |
| 41 | $price_html = '<div class="tutor-d-flex tutor-align-items-center tutor-justify-content-between"><div class="list-item-price tutor-d-flex tutor-align-items-center"> <span class="price tutor-fs-6 tutor-fw-bold tutor-color-black">'.$product->get_price_html() . ' </span></div>'; |
| 42 | $restrict = '<div class="list-item-booking booking-full tutor-d-flex tutor-align-items-center"><div class="booking-progress tutor-d-flex"><span class="btn-icon tutor-color-design-warning tutor-icon-circle-outline-info-filled"></span></div><div class="tutor-fs-7 tutor-fw-medium tutor-color-black">'. __('Fully Booked', 'tutor') .'</div></div></div>'; |
| 43 | echo wp_kses_post($price_html); |
| 44 | echo wp_kses_post($restrict); |
| 45 | } |
| 46 | |
| 47 | if ( $product && $maximum_students == 0) { |
| 48 | $price_html = '<div class="tutor-d-flex tutor-align-items-center tutor-justify-content-between"><div class="list-item-price tutor-d-flex tutor-align-items-center"> <span class="price tutor-fs-6 tutor-fw-bold tutor-color-black">'.$product->get_price_html() . ' </span></div>'; |
| 49 | $cart_html = '<div class="list-item-button"> '.apply_filters( 'tutor_course_restrict_new_entry', $enroll_btn ) . ' </div></div>'; |
| 50 | echo wp_kses_post($price_html); |
| 51 | echo wp_kses_post($cart_html); |
| 52 | } |
| 53 | |
| 54 | |
| 55 | } else { |
| 56 | echo wp_kses_post($free_html); |
| 57 | } |
| 58 | ?> |
| 59 |