is_registration_enabled() && $checkout->is_registration_required() && ! is_user_logged_in() ) { echo esc_html( apply_filters( 'woocommerce_checkout_must_be_logged_in_message', __( 'You must be logged in to checkout.', 'motors' ) ) ); return; } function count_active_woocommerce_payment_methods() { $payment_gateways = WC()->payment_gateways->payment_gateways(); $count = 0; foreach ( $payment_gateways as $gateway ) { if ( $gateway->is_available() ) { $count++; } } return $count; } $active_payment_methods_count = count_active_woocommerce_payment_methods(); ?>