diff --git a/includes/parents.php b/includes/parents.php index 7c7a1f0..f48728a 100644 --- a/includes/parents.php +++ b/includes/parents.php @@ -400,3 +400,37 @@ function pmprogroupacct_pmpro_invoice_bullets_bottom_parent( $invoice ) { id ) ) { + $settings = pmprogroupacct_get_settings_for_level( $level->id ); + } + + // If there are no settings, then this is not a group parent level. Bail. + if ( empty( $settings ) ) { + return $include; + } + + // If seats aren't free we must require billing fields despite parent level is free. + if ( intval( $settings['pricing_model_settings'] ) > 0 ) { + global $pmpro_requirebilling; + $pmpro_requirebilling = true; + } + + return $include; +} + +// Hook to include payment information fields. +add_filter( 'pmpro_include_payment_information_fields', 'pmprogroupcct_pmpro_include_payment_information_fields' );