How to Change Postal Code Checking to Prefix Only Checking on WooFood for WooCommerce

The below hook will work for users using Postal Code Restrictions under Distance Restrictions on WooFood .

After using the below hook under postal codes must be added only the postal codes prefixes are available for delivery instead from the whole postal code.

Copy to your child theme functions.php to change the postal code checking to check only the prefix instead of whole postal code.

This is useful for locations like UK where postal codes are too many ands its difficult of adding one by one each postal code in full.

function change_to_prefix_postal_checking( $bool ) {
     return true;
 }
 add_filter( 'woofood_check_postal_prefixes', 'change_to_prefix_postal_checking', 10, 1 );