Ok, I just sent u a message. I really would like to be able to do that through your plugin, since my client would be able to manage that by himself. However, I also would like to know how to do that through php. I do not know if that is on your scope, so here is the code, which is not working, do you know tell me why?
//https://rudrastyh.com/woocommerce/custom-checkout-validation.html - hook woocommerce_after_checkout_validation did not work
//https://stackoverflow.com/questions/28603144/custom-validation-of-woocommerce-checkout-fields
add_action( 'woocommerce_after_checkout_validation', 'misha_validate_fname_lname', 10, 2);
function misha_validate_fname_lname( $fields, $errors ){
if ( strpos( $fields[ 'billing_n_matricula' ], 300) === false ){
$errors->add( 'validation', 'Seu número de matrícula parece estar errado, favor digitar o correto.' );
}
}
It seems the code runs, since I see the validation warning, but it never gets true, to go ahead. Tks!
-
This reply was modified 5 years, 3 months ago by
diegpl.
-
This reply was modified 5 years, 3 months ago by
diegpl.