Voeg deze code toe aan functions.php van je thema of Code Snippets.


add_action('woocommerce_checkout_process', 'custom_validation_process');

function custom_validation_process()
{
global $woocommerce;

if(isset($_POST['billing_address_1']) and $_POST['billing_address_1'] != '')
{
if (!preg_match('/([0-9]+)/Uis', $_POST['billing_address_1']))
{
if(function_exists('wc_add_notice'))
wc_add_notice( __('Oeps, vergeet niet je huisnummer in te vullen in het adresveld.'), 'error' );
else
$woocommerce->add_error( __('Oops, vergeet niet je huisnummer in te vullen in het adresveld.') );
}
}

if(isset($_POST['ship_to_different_address']))
{
if(isset($_POST['shipping_address_1']) and $_POST['shipping_address_1'] != '')
{
if (!preg_match('/([0-9]+)/Uis', $_POST['shipping_address_1']))
{
if(function_exists('wc_add_notice'))
wc_add_notice( __('Oops, vergeet niet je huisnummer in te vullen in het adresveld.'), 'error' );
else
$woocommerce->add_error( __('Oops, vergeet niet je huisnummer in te vullen in het adresveld.') );
}
}
}
}