Woocommerce Checkout - Add conditional field required if one field is filled
PHP Snippet 1:
add_action( 'woocommerce_checkout_process', 'afm_validation' );
function afm_validation() {
if ( isset($_POST['wi_as_company']) && isset($_POST['billing_company_wi_id']) && empty($_POST['billing_company_wi_id']) ) {
wc_add_notice( __("Please fill company ID"), "error" );
}
}