diff --git a/pmpro-payment-plans.php b/pmpro-payment-plans.php index cddf506..710a83b 100644 --- a/pmpro-payment-plans.php +++ b/pmpro-payment-plans.php @@ -426,29 +426,41 @@ function pmpropp_render_payment_plans_checkout() { } } - if ( ! empty( $level->id ) ) { - - $plans = pmpropp_return_payment_plans( intval( $level->id ) ); - - if ( ! empty( $plans ) ) { - ?> -
-
-
- -

-
-
-
- -
-
+ //Bail if empty level. + if ( empty( $level->id ) ) { + return; + } + + + $plans = pmpropp_return_payment_plans( intval( $level->id ) ); + + //Bail if no plans. + if ( empty( $plans ) ) { + return; + } + + //Bail if discount code is being used. + if ( isset( $level->code_id ) ) { + return; + } + + ?> +
+
+
+ +

+
+
+
+
-
- +
+
+ payment_plans = $payment_plans; return $membership_level; } - add_filter( 'pmpro_site_health_info_membership_level', 'pmpropp_add_payment_plans_to_site_health', 1, 1 ); +