| @@ -1,53 +1,73 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Template for displaying user email field which enable checkout as guest. | |
| 4 | - * | |
| 5 | - * This template can be overridden by copying it to yourtheme/learnpress/checkout/guest-email.php. | |
| 6 | - * | |
| 7 | - * @author ThimPress | |
| 8 | - * @package Learnpress/Templates | |
| 9 | - * @version 4.0.0 | |
| 10 | - */ | |
| 11 | - | |
| 12 | -defined( 'ABSPATH' ) || exit(); | |
| 13 | - | |
| 14 | -$checkout = LearnPress::instance()->checkout(); | |
| 15 | -$is_exists = $checkout->checkout_email_exists(); | |
| 16 | -?> | |
| 17 | - | |
| 18 | -<input type="radio" id="checkout-account-switch-to-guest" name="checkout-account-switch-form" value="guest" checked="checked"/> | |
| 19 | - | |
| 20 | -<div id="checkout-account-guest" class="lp-checkout-block <?php echo esc_attr( $is_exists ? 'email-exists' : '' ); ?>"> | |
| 21 | - <h4><?php esc_html_e( 'As Guest', 'learnpress' ); ?></h4> | |
| 22 | - <ul class="lp-form-fields"> | |
| 23 | - <li class="form-field"> | |
| 24 | - <input size="30" placeholder="<?php esc_attr_e( 'Enter your email...', 'learnpress' ); ?>" type="text" id="guest_email" name="guest_email" autocomplete="off"> | |
| 25 | - <div class="lp-guest-checkout-notice"> | |
| 26 | - <?php esc_html_e( 'An order key to activate the course will be sent to your email after the payment has proceeded successfully.', 'learnpress' ); ?> | |
| 27 | - </div> | |
| 28 | - | |
| 29 | - <?php | |
| 30 | - $signin = ''; | |
| 31 | - $signup = ''; | |
| 32 | - $divider = ''; | |
| 33 | - | |
| 34 | - if ( LearnPress::instance()->checkout()->is_enable_login() ) { | |
| 35 | - $signin = sprintf( '<a href="javascript:void(0)"><label for="checkout-account-switch-to-login">%s</label></a>', esc_html( _x( 'Sign in', 'checkout sign in link', 'learnpress' ) ) ); | |
| 36 | - } | |
| 37 | - | |
| 38 | - if ( LearnPress::instance()->checkout()->is_enable_login() && LearnPress::instance()->checkout()->is_enable_register() ) { | |
| 39 | - $divider = ','; | |
| 40 | - } | |
| 41 | - | |
| 42 | - if ( LearnPress::instance()->checkout()->is_enable_register() ) { | |
| 43 | - $signup = sprintf( '<a href="javascript:void(0)"><label for="checkout-account-switch-to-register">%s</label></a>', esc_html( _x( 'Sign up', 'checkout sign up link', 'learnpress' ) ) ); | |
| 44 | - } | |
| 45 | - ?> | |
| 46 | - | |
| 47 | - <?php if ( LearnPress::instance()->checkout()->is_enable_login() || LearnPress::instance()->checkout()->is_enable_register() ) : ?> | |
| 48 | - <div class="lp-guest-switch-login"><?php echo sprintf( __( 'Or you can %1$s%2$s %3$s now.', 'learnpress' ), $signin, $divider, $signup ); ?></div> | |
| 49 | - <?php endif; ?> | |
| 50 | - </li> | |
| 51 | - </ul> | |
| 52 | -<!-- <input type="hidden" name="learn-press-checkout-nonce" value="--><?php //echo esc_attr( wp_create_nonce( 'learn-press-guest-checkout' ) ); ?><!--"/>--> | |
| 53 | -</div> | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Template for displaying user email field which enable checkout as guest. | |
| 4 | + * | |
| 5 | + * This template can be overridden by copying it to yourtheme/learnpress/checkout/guest-email.php. | |
| 6 | + * | |
| 7 | + * @author ThimPress | |
| 8 | + * @package Learnpress/Templates | |
| 9 | + * @version 4.0.1 | |
| 10 | + */ | |
| 11 | + | |
| 12 | +defined( 'ABSPATH' ) || exit(); | |
| 13 | + | |
| 14 | +$checkout = LearnPress::instance()->checkout(); | |
| 15 | +$is_exists = $checkout->checkout_email_exists(); | |
| 16 | +?> | |
| 17 | + | |
| 18 | +<div id="checkout-account-guest" class="lp-checkout-block <?php echo esc_attr( $is_exists ? 'email-exists' : '' ); ?>"> | |
| 19 | + <h4><?php esc_html_e( 'As Guest', 'learnpress' ); ?></h4> | |
| 20 | + <ul class="lp-form-fields"> | |
| 21 | + <li class="form-field"> | |
| 22 | + <input size="30" placeholder="<?php esc_attr_e( 'Enter your email...', 'learnpress' ); ?>" type="text" id="guest_email" name="guest_email" autocomplete="off"> | |
| 23 | + <div class="lp-guest-checkout-notice"> | |
| 24 | + <?php esc_html_e( 'An order key to activate the course will be sent to your email after the payment has proceeded successfully.', 'learnpress' ); ?> | |
| 25 | + </div> | |
| 26 | + | |
| 27 | + <?php | |
| 28 | + $signin = ''; | |
| 29 | + $signup = ''; | |
| 30 | + $divider = ''; | |
| 31 | + | |
| 32 | + if ( LearnPress::instance()->checkout()->is_enable_login() ) { | |
| 33 | + $signin = sprintf( | |
| 34 | + '<a href="%s">%s</a>', | |
| 35 | + esc_url( | |
| 36 | + add_query_arg( | |
| 37 | + 'is_form_login', | |
| 38 | + '1', | |
| 39 | + LP_Helper::get_link_no_cache( learn_press_get_page_link( 'checkout' ) ) | |
| 40 | + ) | |
| 41 | + ), | |
| 42 | + esc_html( _x( 'Sign in', 'checkout sign in link', 'learnpress' ) ) | |
| 43 | + ); | |
| 44 | + } | |
| 45 | + | |
| 46 | + if ( LearnPress::instance()->checkout()->is_enable_login() | |
| 47 | + && LearnPress::instance()->checkout()->is_enable_register() ) { | |
| 48 | + $divider = ','; | |
| 49 | + } | |
| 50 | + | |
| 51 | + if ( LearnPress::instance()->checkout()->is_enable_register() ) { | |
| 52 | + $signup = sprintf( | |
| 53 | + '<a href="%s">%s</a>', | |
| 54 | + esc_url( | |
| 55 | + add_query_arg( | |
| 56 | + 'is_form_register', | |
| 57 | + '1', | |
| 58 | + LP_Helper::get_link_no_cache( learn_press_get_page_link( 'checkout' ) ) | |
| 59 | + ) | |
| 60 | + ), | |
| 61 | + esc_html( _x( 'Sign up', 'checkout sign up link', 'learnpress' ) ) | |
| 62 | + ); | |
| 63 | + } | |
| 64 | + ?> | |
| 65 | + | |
| 66 | + <?php if ( LearnPress::instance()->checkout()->is_enable_login() || LearnPress::instance()->checkout()->is_enable_register() ) : ?> | |
| 67 | + <div class="lp-guest-switch-login"> | |
| 68 | + <?php echo sprintf( __( 'Or you can %1$s%2$s %3$s now.', 'learnpress' ), $signin, $divider, $signup ); ?> | |
| 69 | + </div> | |
| 70 | + <?php endif; ?> | |
| 71 | + </li> | |
| 72 | + </ul> | |
| 73 | +</div> | |