wc_delivery_in_delivery_area_type
Signature
apply_filters( 'wc_delivery_in_delivery_area_type', string $check_type );
| Parameter |
Type |
Description |
$check_type |
string |
Default 'area'. Return one of 'area', 'zip_codes', 'product_vendors_service_area'. |
What it does
When the app calls the wc_delivery_in_delivery_area subaction (to validate a customer’s delivery address), this filter picks the validation strategy:
| Return value |
Check performed |
area (default) |
Point-in-polygon against the store post’s delivery_area meta (polygons drawn on the app map). Store id from store_id request param, overridable via mam_wc_delivery_store_id_for_delivery_area. Coordinates from check_lat/check_lon. |
zip_codes |
The zip request param must appear in the mam_wc_delivery_area_zip_codes list (exact string match). |
product_vendors_service_area |
Distance from check_lat/check_lon to the vendor’s lat/lon must be within the vendor’s service_radius (Product Vendors taxonomy meta; a 0 radius falls back to 50). |
The subaction responds {"allowed":"yes"} or {"allowed":"no"}.
mam_wc_delivery_area_zip_codes
Signature
apply_filters( 'mam_wc_delivery_area_zip_codes', array $zip_codes );
| Parameter |
Type |
Description |
$zip_codes |
array |
Default array() (nothing allowed). Return the allow-list of zip strings. |
Only consulted when the check type is zip_codes. Matching is strict (in_array( $zip, $zip_codes, true )), so list zips as strings.
Example — validate by zip codes
add_filter( 'wc_delivery_in_delivery_area_type', function () {
return 'zip_codes';
} );
add_filter( 'mam_wc_delivery_area_zip_codes', function ( $zips ) {
return array( '02108', '02109', '02110' );
} );
Related articles
- Recipe: Configure delivery areas
- Plugin: mam-woocommerce-delivery
| Field |
Value |
| Article type |
Hook Reference |
| Plugin slug |
mam-woocommerce-delivery |
| Applies to plugin version |
1.4.1+ |
| Category |
Extending MAM Suite |
| Hook type |
filter (both) |
| Audience |
PHP developer |
| Last verified |
2026-06-10 |