| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for displaying checkout form. |
| 4 |
* |
| 5 |
* This template can be overridden by copying it to yourtheme/learnpress/checkout/form.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 |
|
| 16 |
learn_press_print_messages(); |
| 17 |
|
| 18 |
if ( ! is_user_logged_in() ) { |
| 19 |
?> |
| 20 |
<div class="learn-press-message error"> |
| 21 |
<?php _e( 'Please log in to enroll in the course!', 'learnpress' ); ?> |
| 22 |
</div> |
| 23 |
<?php |
| 24 |
} |
| 25 |
?> |
| 26 |
|
| 27 |
<form method="post" id="learn-press-checkout-form" name="learn-press-checkout-form" class="lp-checkout-form" tabindex="0" action="<?php echo esc_url_raw( learn_press_get_checkout_url() ); ?>" enctype="multipart/form-data"> |
| 28 |
<?php |
| 29 |
if ( has_action( 'learn-press/before-checkout-form' ) ) { |
| 30 |
?> |
| 31 |
<div class="lp-checkout-form__before"> |
| 32 |
<?php do_action( 'learn-press/before-checkout-form' ); ?> |
| 33 |
</div> |
| 34 |
<?php |
| 35 |
} |
| 36 |
|
| 37 |
do_action( 'learn-press/checkout-form' ); |
| 38 |
|
| 39 |
if ( has_action( 'learn-press/after-checkout-form' ) ) { |
| 40 |
?> |
| 41 |
<div class="lp-checkout-form__after"> |
| 42 |
<?php do_action( 'learn-press/after-checkout-form' ); ?> |
| 43 |
</div> |
| 44 |
<?php |
| 45 |
} |
| 46 |
?> |
| 47 |
</form> |
| 48 |
|
| 49 |
<?php |
| 50 |
|