PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.9
4.4.9.1 4.4.9 4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 All 141 releases
← All changes | inc/templates/class-lp-template-checkout.php +19 -4 4.1.7.2 → 4.4.9 View file →
@@ -16,9 +16,9 @@
16 16 parent::__construct();
17 17 }
18 18
19 19 public function review_order() {
20 - $cart = learn_press_get_checkout_cart();
20 + $cart = LearnPress::instance()->cart;
21 21 learn_press_get_template( 'checkout/review-order', compact( 'cart' ) );
22 22 }
23 23
24 24 public function payment() {
@@ -39,17 +39,28 @@
39 39 learn_press_get_template( 'checkout/account-logged-in' );
40 40 }
41 41
42 42 public function account_login() {
43 - if ( is_user_logged_in() || ! LearnPress::instance()->checkout()->is_enable_login() ) {
43 + $checkout = LearnPress::instance()->checkout();
44 +
45 + if ( is_user_logged_in()
46 + || ! $checkout->is_enable_login()
47 + || ( $checkout->is_enable_guest_checkout() && ! isset( $_GET['is_form_login'] ) ) ) {
44 48 return;
45 49 }
46 50
51 + if ( isset( $_GET['is_form_register'] ) ) {
52 + return;
53 + }
54 +
47 55 learn_press_get_template( 'checkout/account-login' );
48 56 }
49 57
50 58 public function account_register() {
51 - if ( is_user_logged_in() || ! LearnPress::instance()->checkout()->is_enable_register() ) {
59 + if ( is_user_logged_in()
60 + || ! LearnPress::instance()->checkout()->is_enable_register()
61 + || isset( $_GET['is_form_login'] )
62 + || ! isset( $_GET['is_form_register'] ) ) {
52 63 return;
53 64 }
54 65
55 66 learn_press_get_template( 'checkout/account-register' );
@@ -55,9 +66,13 @@
55 66 learn_press_get_template( 'checkout/account-register' );
56 67 }
57 68
58 69 public function guest_checkout() {
59 - if ( is_user_logged_in() || ! LearnPress::instance()->checkout()->is_enable_guest_checkout() ) {
70 + $is_account_form = isset( $_GET['is_form_login'] ) || isset( $_GET['is_form_register'] );
71 +
72 + if ( is_user_logged_in()
73 + || ! LearnPress::instance()->checkout()->is_enable_guest_checkout()
74 + || $is_account_form ) {
60 75 return;
61 76 }
62 77
63 78 learn_press_get_template( 'checkout/guest-checkout' );