Here is a small snippet to make WooFood compatible with Multistep Checkout Pro.
Just copy and and paste the following code to your functions.php on your child theme.
if ( ! function_exists( 'wpslash_multistep_checkout_postal_code_validation' ) ) {
function wpslash_multistep_checkout_postal_code_validation( $errors, $fields ) {
$options_woofood = get_option('woofood_options');
$woofood_postalcodes = isset($options_woofood['woofood_postalcodes']) ? $options_woofood['woofood_postalcodes'] : null;
$woofood_postalcodes = str_replace(" ", "", $woofood_postalcodes);
$woofood_postalcodes = strtoupper($woofood_postalcodes);
$woofood_current_postcode = $fields['billing_postcode'];
$woofood_current_postcode = str_replace(" ", "", $woofood_current_postcode);
$woofood_current_postcode = strtoupper($woofood_current_postcode);
$postal_codes_array = explode(",", trim($woofood_postalcodes));
if(!in_array(trim($woofood_current_postcode), $postal_codes_array))
{
$errors['billing_postcode'] = __( 'Your postcode is outside our delivery area' );
}
return $errors;
}
}
add_action( 'wmsc_custom_validation', 'wpslash_multistep_checkout_postal_code_validation', 10, 2 );