add-to-cart-edd.php
5 years ago
add-to-cart-woocommerce.php
5 years ago
course-author.php
5 years ago
course-continue.php
5 years ago
course-price-edd.php
5 years ago
course-price-woocommerce.php
5 years ago
course-price.php
5 years ago
course.php
5 years ago
end_content_wrap.php
5 years ago
footer.php
5 years ago
header.php
5 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
5 years ago
meta.php
5 years ago
rating.php
5 years ago
start_content_wrap.php
5 years ago
thumbnail.php
5 years ago
title.php
5 years ago
tutor-pagination.php
5 years ago
add-to-cart-edd.php
29 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package TutorLMS/Templates |
| 4 | * @version 1.4.3 |
| 5 | */ |
| 6 | $product_id = tutor_utils()->get_course_product_id(); |
| 7 | $download = new EDD_Download( $product_id ); |
| 8 | |
| 9 | if ($download->ID) { |
| 10 | if(!is_user_logged_in()) { |
| 11 | /** |
| 12 | * Add required loggedin class |
| 13 | * @since v 1.5.5 |
| 14 | */ |
| 15 | $button_behavior = edd_get_download_button_behavior( $download->ID ); |
| 16 | $args = apply_filters( 'edd_purchase_link_defaults', array( |
| 17 | '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' ) ), |
| 18 | 'style' => edd_get_option( 'button_style', 'button' ), |
| 19 | 'color' => edd_get_option( 'checkout_color', 'blue' ), |
| 20 | 'class' => 'edd-submit cart-required-login' |
| 21 | ) ); |
| 22 | $button_text = edd_currency_filter( edd_format_amount( $download->price ) ) .' – '. $args['text']; |
| 23 | $button_class = implode( ' ', array( $args['style'], $args['color'], $args['class'] ) ); |
| 24 | |
| 25 | echo '<button class="'.$button_class.'">'.$button_text.'</button>'; |
| 26 | } else { |
| 27 | echo edd_get_purchase_link( array( 'download_id' => $download->ID ) ); |
| 28 | } |
| 29 | } |