芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/socialdigivlms.com/wp-content/plugins/tutor/templates/loop/course-price.php
* @link https://themeum.com * @since 1.4.3 */ ?> get_option( 'monetize_by' ); /** * If Monetization is PMPRO then ignore ajax enrolment * to avoid Paid course enrollment without payment. * * Note: There is no mapping between Tutor Course and PMPRO * That is way there is no way to determine whether course if free * or paid * * @since v2.1.2 */ $button_class = 'pmpro' === $monetization || $password_protected ? ' ' : ' tutor-course-list-enroll'; if ( ! is_user_logged_in() ) { $button_class = apply_filters( 'tutor_enroll_required_login_class', 'tutor-open-login-modal' ); } $enroll_now_attrs = apply_filters( 'tutor_enroll_now_link_attrs', array(), $course_id ); $attrs_string = ''; foreach ( $enroll_now_attrs as $key => $value ) { $attrs_string .= sprintf( '%s="%s" ', esc_attr( $key ), esc_attr( $value ) ); } $enroll_btn = '
' . apply_filters( 'tutor_course_restrict_new_entry', '
' . __( 'Enroll Course', 'tutor' ) . '
', $course_id ) . '
'; $free_html = $enroll_btn; if ( tutor_utils()->is_course_purchasable() && 'wc' === $monetization ) { $enroll_btn = tutor_course_loop_add_to_cart( false ); $product_id = tutor_utils()->get_course_product_id( $course_id ); $product = function_exists( 'wc_get_product' ) ? wc_get_product( $product_id ) : 0; $total_enrolled = (int) tutor_utils()->count_enrolled_users_by_course( $course_id ); $maximum_students = (int) tutor_utils()->get_course_settings( $course_id, 'maximum_students' ); if ( $product && 0 != $maximum_students && $total_enrolled != $maximum_students ) { $total_booked = 100 / $maximum_students * $total_enrolled; $b_total = $total_booked; //phpcs:disable WordPress.Security.EscapeOutput.OutputNotEscaped echo '
' . $product->get_price_html() . '
' . esc_html( $b_total ) . __( '% Booked', 'tutor' ) . '
' . apply_filters( 'tutor_course_restrict_new_entry', $enroll_btn, $course_id ) . '
'; } if ( $product && $maximum_students == $total_enrolled && 0 != $maximum_students ) { $price_html = '
' . $product->get_price_html() . '
'; $restrict = '
' . __( 'Fully Booked', 'tutor' ) . '
'; echo wp_kses_post( $price_html ); echo wp_kses_post( $restrict ); } if ( $product && 0 == $maximum_students ) { $price_html = '
' . $product->get_price_html() . '
'; $cart_html = '
' . apply_filters( 'tutor_course_restrict_new_entry', $enroll_btn, $course_id ) . '
'; echo wp_kses_post( $price_html ); echo wp_kses_post( $cart_html ); } } else { echo wp_kses_post( $free_html ); }