WPSlash Licences

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

Published
Updated
Reading time
1 minutes
Written by
WPSlash team

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.

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

FoodMaster (formerly WooFood)12 min read

Best Store Address Setup for Pickup

Compare single-address, multi-location, and directions-first pickup setups to reduce wrong-door visits and simplify checkout.

The plugins these guides are about

FoodMaster for restaurants, courier vouchers for the Greek market, marketplace sync and store tools, all for WooCommerce.

Browse plugins30-day money-back on every plugin