| @@ -1,83 +1,83 @@ | ||
| 1 | -<?php | |
| 2 | -/** | |
| 3 | - * Template for displaying payment form for checkout page. | |
| 4 | - * | |
| 5 | - * Edit by Nhamdv | |
| 6 | - * | |
| 7 | - * This template can be overridden by copying it to yourtheme/learnpress/checkout/payment.php. | |
| 8 | - * | |
| 9 | - * @author ThimPress | |
| 10 | - * @package Learnpress/Templates | |
| 11 | - * @version 4.0.0 | |
| 12 | - */ | |
| 13 | - | |
| 14 | -defined( 'ABSPATH' ) || exit(); | |
| 15 | -?> | |
| 16 | - | |
| 17 | -<div id="checkout-payment" class="lp-checkout-block left"> | |
| 18 | - <?php | |
| 19 | - do_action( 'learn-press/before-payment-methods' ); | |
| 20 | - | |
| 21 | - // Show payments if cart total > 0 and have at least one payment method. | |
| 22 | - if ( LearnPress::instance()->cart && LearnPress::instance()->cart->needs_payment() && $available_gateways ) { | |
| 23 | - ?> | |
| 24 | - <h4> | |
| 25 | - <?php esc_html_e( 'Payment', 'learnpress' ); ?> | |
| 26 | - <span class="secure-connection"> | |
| 27 | - <i class="lp-icon-lock"></i> | |
| 28 | - <?php echo esc_html_x( 'Secure Connection', 'payment method', 'learnpress' ); ?> | |
| 29 | - </span> | |
| 30 | - </h4> | |
| 31 | - | |
| 32 | - <ul class="payment-methods"> | |
| 33 | - <?php | |
| 34 | - $order = 1; | |
| 35 | - | |
| 36 | - foreach ( $available_gateways as $gateway ) { | |
| 37 | - if ( $order == 1 ) { | |
| 38 | - learn_press_get_template( | |
| 39 | - 'checkout/payment-method.php', | |
| 40 | - array( | |
| 41 | - 'gateway' => $gateway, | |
| 42 | - 'selected' => $gateway->id, | |
| 43 | - ) | |
| 44 | - ); | |
| 45 | - } else { | |
| 46 | - learn_press_get_template( | |
| 47 | - 'checkout/payment-method.php', | |
| 48 | - array( | |
| 49 | - 'gateway' => $gateway, | |
| 50 | - 'selected' => '', | |
| 51 | - ) | |
| 52 | - ); | |
| 53 | - } | |
| 54 | - $order ++; | |
| 55 | - } | |
| 56 | - ?> | |
| 57 | - </ul> | |
| 58 | - | |
| 59 | - <?php | |
| 60 | - } | |
| 61 | - | |
| 62 | - do_action( 'learn-press/payment-form' ); | |
| 63 | - ?> | |
| 64 | - | |
| 65 | - <div id="checkout-order-action" class="place-order-action"> | |
| 66 | - | |
| 67 | - <?php do_action( 'learn-press/before-checkout-submit-button' ); ?> | |
| 68 | - | |
| 69 | - <button type="submit" class="lp-button button alt" name="learn_press_checkout_place_order" id="learn-press-checkout-place-order"> | |
| 70 | - <?php echo apply_filters( 'learn-press/checkout-proceed-button-text', esc_html__( 'Place order', 'learnpress' ) ); ?> | |
| 71 | - </button> | |
| 72 | - | |
| 73 | - <?php | |
| 74 | - /*if ( is_user_logged_in() ) { | |
| 75 | - wp_nonce_field( 'learn-press-user-logged', 'learn-press-checkout-nonce' ); | |
| 76 | - }*/ | |
| 77 | - | |
| 78 | - do_action( 'learn-press/after-checkout-submit-button' ); | |
| 79 | - ?> | |
| 80 | - </div> | |
| 81 | - | |
| 82 | - <?php do_action( 'learn-press/after-payment-form' ); ?> | |
| 83 | -</div> | |
| 1 | +<?php | |
| 2 | +/** | |
| 3 | + * Template for displaying payment form for checkout page. | |
| 4 | + * | |
| 5 | + * Edit by Nhamdv | |
| 6 | + * | |
| 7 | + * This template can be overridden by copying it to yourtheme/learnpress/checkout/payment.php. | |
| 8 | + * | |
| 9 | + * @author ThimPress | |
| 10 | + * @package Learnpress/Templates | |
| 11 | + * @version 4.0.0 | |
| 12 | + */ | |
| 13 | + | |
| 14 | +defined( 'ABSPATH' ) || exit(); | |
| 15 | +?> | |
| 16 | + | |
| 17 | +<div id="checkout-payment" class="lp-checkout-block left"> | |
| 18 | + <?php | |
| 19 | + do_action( 'learn-press/before-payment-methods' ); | |
| 20 | + | |
| 21 | + // Show payments if cart total > 0 and have at least one payment method. | |
| 22 | + if ( LearnPress::instance()->cart && LearnPress::instance()->cart->needs_payment() && $available_gateways ) { | |
| 23 | + ?> | |
| 24 | + <h4> | |
| 25 | + <?php esc_html_e( 'Payment', 'learnpress' ); ?> | |
| 26 | + <span class="secure-connection"> | |
| 27 | + <i class="lp-icon-lock"></i> | |
| 28 | + <?php echo esc_html_x( 'Secure Connection', 'payment method', 'learnpress' ); ?> | |
| 29 | + </span> | |
| 30 | + </h4> | |
| 31 | + | |
| 32 | + <ul class="payment-methods"> | |
| 33 | + <?php | |
| 34 | + $order = 1; | |
| 35 | + | |
| 36 | + foreach ( $available_gateways as $gateway ) { | |
| 37 | + if ( $order == 1 ) { | |
| 38 | + learn_press_get_template( | |
| 39 | + 'checkout/payment-method.php', | |
| 40 | + array( | |
| 41 | + 'gateway' => $gateway, | |
| 42 | + 'selected' => $gateway->id, | |
| 43 | + ) | |
| 44 | + ); | |
| 45 | + } else { | |
| 46 | + learn_press_get_template( | |
| 47 | + 'checkout/payment-method.php', | |
| 48 | + array( | |
| 49 | + 'gateway' => $gateway, | |
| 50 | + 'selected' => '', | |
| 51 | + ) | |
| 52 | + ); | |
| 53 | + } | |
| 54 | + $order ++; | |
| 55 | + } | |
| 56 | + ?> | |
| 57 | + </ul> | |
| 58 | + | |
| 59 | + <?php | |
| 60 | + } | |
| 61 | + | |
| 62 | + do_action( 'learn-press/payment-form' ); | |
| 63 | + ?> | |
| 64 | + | |
| 65 | + <div id="checkout-order-action" class="place-order-action"> | |
| 66 | + | |
| 67 | + <?php do_action( 'learn-press/before-checkout-submit-button' ); ?> | |
| 68 | + | |
| 69 | + <button type="submit" class="lp-button button alt" name="learn_press_checkout_place_order" id="learn-press-checkout-place-order"> | |
| 70 | + <?php echo apply_filters( 'learn-press/checkout-proceed-button-text', esc_html__( 'Place order', 'learnpress' ) ); ?> | |
| 71 | + </button> | |
| 72 | + | |
| 73 | + <?php | |
| 74 | + /*if ( is_user_logged_in() ) { | |
| 75 | + wp_nonce_field( 'learn-press-user-logged', 'learn-press-checkout-nonce' ); | |
| 76 | + }*/ | |
| 77 | + | |
| 78 | + do_action( 'learn-press/after-checkout-submit-button' ); | |
| 79 | + ?> | |
| 80 | + </div> | |
| 81 | + | |
| 82 | + <?php do_action( 'learn-press/after-payment-form' ); ?> | |
| 83 | +</div> | |