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