add-to-cart-edd.php
5 years ago
add-to-cart-woocommerce.php
5 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
footer.php
5 years ago
header.php
4 years ago
loop-after-content.php
5 years ago
loop-before-content.php
5 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
5 years ago
thumbnail.php
5 years ago
title.php
4 years ago
tutor-pagination.php
5 years ago
course-price-woocommerce.php
44 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 | |
| 15 | <div class="tutor-course-loop-price"> |
| 16 | <?php |
| 17 | $course_id = get_the_ID(); |
| 18 | $is_public = get_post_meta( $course_id, '_tutor_is_public_course', true ) == 'yes'; |
| 19 | $enroll_btn = '<div class="tutor-public-course-start-learning">' . apply_filters( 'tutor_course_restrict_new_entry', '<a href="' . get_the_permalink() . '">' . __( 'Get Enrolled', 'tutor' ) . '</a>' ) . '</div>'; |
| 20 | $default_price = apply_filters( 'tutor-loop-default-price', ( $is_public ? '' : __( 'Free', 'tutor' ) ) ); |
| 21 | $price_html = '<div class="price"> ' . $default_price . $enroll_btn . '</div>'; |
| 22 | if ( tutor_utils()->is_course_purchasable() ) { |
| 23 | $enroll_btn = tutor_course_loop_add_to_cart( false ); |
| 24 | |
| 25 | $product_id = tutor_utils()->get_course_product_id( $course_id ); |
| 26 | $product = wc_get_product( $product_id ); |
| 27 | |
| 28 | if ( $product ) { |
| 29 | $price_html = '<div class="price"> ' . $product->get_price_html() . apply_filters( 'tutor_course_restrict_new_entry', $enroll_btn ) . ' </div>'; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | if ( $is_public ) { |
| 34 | $price_html = '<div class="price"> |
| 35 | ' . __( 'Free', 'tutor' ) . ' |
| 36 | <a class="tutor-public-course-start-learning" href="' . get_the_permalink() . '"> |
| 37 | ' . __( 'Start Learning ', 'tutor' ) . ' |
| 38 | </a></div>'; |
| 39 | } |
| 40 | |
| 41 | echo $price_html; |
| 42 | ?> |
| 43 | </div> |
| 44 |