add-to-cart-edd.php
3 years ago
add-to-cart-woocommerce.php
4 years ago
course-author.php
3 years ago
course-continue.php
3 years ago
course-in-cart.php
4 years ago
course-price-edd.php
3 years ago
course-price-woocommerce.php
3 years ago
course-price.php
3 years ago
course.php
3 years ago
end_content_wrap.php
5 years ago
enrolled-course-progress.php
4 years ago
footer.php
4 years ago
header.php
3 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
3 years ago
rating.php
4 years ago
start_content_wrap.php
4 years ago
thumbnail.php
4 years ago
title.php
4 years ago
add-to-cart-edd.php
37 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Edd price template for the course list page |
| 4 | * |
| 5 | * @package TutorLMS/Templates |
| 6 | * @version 1.4.3 |
| 7 | */ |
| 8 | |
| 9 | $product_id = tutor_utils()->get_course_product_id(); |
| 10 | $download = new EDD_Download( $product_id ); |
| 11 | |
| 12 | if ( $download->ID ) { |
| 13 | if ( ! is_user_logged_in() ) { |
| 14 | /** |
| 15 | * Add required logged in class |
| 16 | * |
| 17 | * @since v 1.5.5 |
| 18 | */ |
| 19 | $button_behavior = edd_get_download_button_behavior( $download->ID ); |
| 20 | $args = apply_filters( |
| 21 | 'edd_purchase_link_defaults', |
| 22 | array( |
| 23 | 'text' => $button_behavior == 'direct' ? edd_get_option( 'buy_now_text', __( 'Buy Now', 'easy-digital-downloads' ) ) : edd_get_option( 'add_to_cart_text', __( 'Purchase', 'easy-digital-downloads' ) ), |
| 24 | 'style' => edd_get_option( 'button_style', 'button' ), |
| 25 | 'color' => edd_get_option( 'checkout_color', 'blue' ), |
| 26 | 'class' => 'edd-submit tutor-open-login-modal', |
| 27 | ) |
| 28 | ); |
| 29 | $button_text = edd_currency_filter( edd_format_amount( $download->price ) ) . ' – ' . $args['text']; |
| 30 | $button_class = implode( ' ', array( $args['style'], $args['color'], $args['class'] ) ); |
| 31 | |
| 32 | echo '<button class="' . esc_attr( $button_class ) . '">' . $button_text . '</button>'; //phpcs:ignore |
| 33 | } else { |
| 34 | echo edd_get_purchase_link( array( 'download_id' => $download->ID ) ); //phpcs:ignore |
| 35 | } |
| 36 | } |
| 37 |