add-to-cart-edd.php
1 year ago
add-to-cart-tutor.php
1 year ago
add-to-cart-woocommerce.php
1 year ago
course-author.php
3 years ago
course-continue.php
2 years ago
course-in-cart.php
1 year ago
course-price-edd.php
1 year ago
course-price-tutor.php
1 year ago
course-price-woocommerce.php
1 year ago
course-price.php
1 year ago
course.php
1 year ago
end_content_wrap.php
3 years ago
enrolled-course-progress.php
3 years ago
footer.php
1 year ago
header.php
3 years ago
loop-after-content.php
3 years ago
loop-before-content.php
3 years ago
loop-end.php
3 years ago
loop-start.php
3 years ago
meta.php
3 years ago
rating.php
3 years ago
start_content_wrap.php
3 years ago
thumbnail.php
3 years ago
title.php
3 years ago
course-in-cart.php
35 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Course loop show view cart if in added to. |
| 4 | * |
| 5 | * @package Tutor\Templates |
| 6 | * @subpackage CourseLoopPart |
| 7 | * @author Themeum <support@themeum.com> |
| 8 | * @link https://themeum.com |
| 9 | * @since 1.7.5 |
| 10 | */ |
| 11 | |
| 12 | ?> |
| 13 | |
| 14 | <div class="tutor-course-loop-price"> |
| 15 | <?php |
| 16 | $course_id = get_the_ID(); |
| 17 | $cart_url = function_exists( 'wc_get_cart_url' ) ? wc_get_cart_url() : '#'; |
| 18 | $enroll_btn = '<div class="tutor-loop-cart-btn-wrap"><a href="' . $cart_url . '" class="tutor-btn tutor-btn-outline-primary tutor-btn-md"><span class="tutor-icon-cart-line tutor-mr-8"></span><span>' . __( 'View Cart', 'tutor' ) . '</span></a></div>'; |
| 19 | $default_price = apply_filters( 'tutor-loop-default-price', __( 'Free', 'tutor' ) ); |
| 20 | $price_html = '<div class="price"> ' . $default_price . $enroll_btn . '</div>'; |
| 21 | if ( tutor_utils()->is_course_purchasable() ) { |
| 22 | |
| 23 | $product_id = tutor_utils()->get_course_product_id( $course_id ); |
| 24 | $product = wc_get_product( $product_id ); |
| 25 | |
| 26 | if ( $product ) { |
| 27 | $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>'; |
| 28 | $cart_html = '<div class="list-item-button"> ' . apply_filters( 'tutor_course_restrict_new_entry', $enroll_btn, $course_id ) . ' </div></div>'; |
| 29 | } |
| 30 | } |
| 31 | echo wp_kses_post( $price_html ); |
| 32 | echo wp_kses_post( $cart_html ); |
| 33 | ?> |
| 34 | </div> |
| 35 |