My account edit address check if address_1 contains housenumber
-
Hello,
A lot of customers forget to add their housenumber to the address field, so I use this function to check this.
But this function doens’t work on the my account page edit address.
Who knows the solution?
add_action( ‘woocommerce_after_checkout_validation’, ‘validate_checkout’, 10, 2);
function validate_checkout( $data, $errors ){
if ( ! preg_match(‘/[0-9]/’, $data[ ‘billing_address_1’ ] ) ){
$errors->add( ‘address’, ‘Er is geen huisnummer ingevuld.’ );
}
}
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.