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-in-cart.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Course loop show view cart if in added to. |
| 5 | * |
| 6 | * @since v.1.7.5 |
| 7 | * @author themeum |
| 8 | * @url https://themeum.com |
| 9 | * |
| 10 | * @package TutorLMS/Templates |
| 11 | * @version 1.7.5 |
| 12 | */ |
| 13 | ?> |
| 14 | |
| 15 | <div class="tutor-course-loop-price"> |
| 16 | <?php |
| 17 | $course_id = get_the_ID(); |
| 18 | $cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : '#'; |
| 19 | $enroll_btn = '<div class="tutor-loop-cart-btn-wrap"><a href="' . $cart_url . '">' . __( 'View Cart', 'tutor' ) . '</a></div>'; |
| 20 | $default_price = apply_filters( 'tutor-loop-default-price', __( 'Free', 'tutor' ) ); |
| 21 | $price_html = '<div class="price"> ' . $default_price . $enroll_btn . '</div>'; |
| 22 | if ( tutor_utils()->is_course_purchasable() ) { |
| 23 | |
| 24 | $product_id = tutor_utils()->get_course_product_id( $course_id ); |
| 25 | $product = wc_get_product( $product_id ); |
| 26 | |
| 27 | if ( $product ) { |
| 28 | $price_html = '<div class="price"> ' . $product->get_price_html() . $enroll_btn . ' </div>'; |
| 29 | } |
| 30 | } |
| 31 | echo $price_html; |
| 32 | ?> |
| 33 | </div> |
| 34 |