<?php
// Silence is golden.

	$settings = $this->get_settings_for_display();
    $id = $this->get_id();

    if( class_exists('SFWD_LMS') ) :
        $elementor_editor = \Elementor\Plugin::instance()->editor->is_edit_mode();
        if( $elementor_editor ) {
            $course_id = learndash_post_arr()[0];
        } else {
            $course_id = learndash_get_course_id();
        }

        $course_price_type = learndash_get_course_meta_setting($course_id, 'course_price_type');

        if( $course_price_type == 'free' || $course_price_type == 'open' ) : ?>
            <div class="wk-learndash-payment-btn-wrapper">
                <a class="btn-join" href="<?php echo esc_url( wp_login_url( get_permalink( $course_id ) ) ); ?>"><?php echo esc_html__( 'Login to Enroll', 'widgetkit-pro' ) ?></a>
            </div>
        <?php elseif( $course_price_type == 'paynow' ):
            echo '<div class="wk-learndash-payment-btn-wrapper">';
                echo do_shortcode('[learndash_payment_buttons course_id="'.$course_id.'"]');
            echo '</div>';
        endif;
    else : ?>
    <div class="plugin-active-massage">
        <h3><?php esc_html_e('Please activate LearnDash LMS plugin first', 'widgetkit-pro');?></h3>
    </div>
    <?php
    endif;