| @@ -5,9 +5,9 @@ | ||
| 5 | 5 | * This template can be overridden by copying it to yourtheme/learnpress/checkout/form.php. |
| 6 | 6 | * |
| 7 | 7 | * @author ThimPress |
| 8 | 8 | * @package Learnpress/Templates |
| 9 | - * @version 4.0.5 | |
| 9 | + * @version 4.0.6 | |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | defined( 'ABSPATH' ) || exit(); |
| 13 | 13 | |
| @@ -14,18 +14,24 @@ | ||
| 14 | 14 | $checkout = LearnPress::instance()->checkout(); |
| 15 | 15 | ?> |
| 16 | 16 | <?php |
| 17 | 17 | if ( ! is_user_logged_in() ) { |
| 18 | + $enable_login_on_page_checkout = LP_Settings::get_option( 'enable_login_checkout', 'yes' ) === 'yes'; | |
| 19 | + $login_text = sprintf( | |
| 20 | + '<a class="lp-link-login" href="%s">%s</a>', | |
| 21 | + learn_press_get_login_url( LP_Helper::getUrlCurrent() ), | |
| 22 | + __( 'login', 'learnpress' ) | |
| 23 | + ); | |
| 24 | + | |
| 25 | + if ( $enable_login_on_page_checkout ) { | |
| 26 | + $login_text = __( 'login', 'learnpress' ); | |
| 27 | + } | |
| 18 | 28 | ?> |
| 19 | 29 | <div class="learn-press-message error"> |
| 20 | 30 | <?php |
| 21 | 31 | printf( |
| 22 | 32 | __( 'Please %s in to enroll in the course!', 'learnpress' ), |
| 23 | - sprintf( | |
| 24 | - '<a class="lp-link-login" href="%s">%s</a>', | |
| 25 | - learn_press_get_login_url( LP_Helper::getUrlCurrent() ), | |
| 26 | - __( 'login', 'learnpress' ) | |
| 27 | - ) | |
| 33 | + $login_text | |
| 28 | 34 | ); |
| 29 | 35 | ?> |
| 30 | 36 | </div> |
| 31 | 37 | <?php |
| @@ -33,10 +39,10 @@ | ||
| 33 | 39 | |
| 34 | 40 | learn_press_show_message(); |
| 35 | 41 | ?> |
| 36 | 42 | <form method="post" id="learn-press-checkout-form" name="learn-press-checkout-form" class="lp-checkout-form" |
| 37 | - tabindex="0" action="<?php echo esc_url_raw( learn_press_get_checkout_url() ); ?>" | |
| 38 | - enctype="multipart/form-data"> | |
| 43 | + tabindex="0" action="<?php echo esc_url_raw( learn_press_get_checkout_url() ); ?>" | |
| 44 | + enctype="multipart/form-data"> | |
| 39 | 45 | <?php |
| 40 | 46 | if ( has_action( 'learn-press/before-checkout-form' ) ) { |
| 41 | 47 | ?> |
| 42 | 48 | <div class="lp-checkout-form__before"> |