Title: Fatal error when no zone set
Last modified: June 19, 2020

---

# Fatal error when no zone set

 *  Resolved [Dave](https://wordpress.org/support/users/csn123/)
 * (@csn123)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-when-no-zone-set/)
 * I’ve set up zones and am using ‘Locations not covered by your other zones’ to
   cover everywhere else in the world. PHP throws a fatal error when using this 
   catch-all fall-back, as the foreach loop is trying to parse an array that doesn’t
   exist.
 * On line 1576, the foreach loop tries to parse the $delivery_zones[$zone_id][‘
   zone_locations’] variable. The fix I’ve come up with is to wrap this as follows:
 *     ```
       					if (!empty($delivery_zones[$zone_id]['zone_locations']) && is_array($delivery_zones[$zone_id]['zone_locations']) && count($delivery_zones[$zone_id]['zone_locations'])>0) {
       						foreach ((array) $delivery_zones[$zone_id]['zone_locations'] as $zlocation ) {
       							$zone_countries[] = $zlocation->code;
       						}
       					}
       ```
   
 * This skips the foreach loop if the default fallback ‘Locations not covered by
   your other zones’ group is used in WooCommerce.
 * I hope this helps others suffering the same problem and hope this code (or similar)
   is added to the plugin in due course to stop such fatal errors.

Viewing 1 replies (of 1 total)

 *  Plugin Author [merlinmonmouth](https://wordpress.org/support/users/merlinmonmouth/)
 * (@merlinmonmouth)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-when-no-zone-set/#post-13072851)
 * Dave
 * We really appreciate you chasing that down – I’ll review it and get it in the
   next release
    Thanks

Viewing 1 replies (of 1 total)

The topic ‘Fatal error when no zone set’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-easy-table-rate-shipping/assets/icon-256x256.
   png?rev=2618390)
 * [Table Rate Shipping for WooCommerce](https://wordpress.org/plugins/woocommerce-easy-table-rate-shipping/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-easy-table-rate-shipping/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-easy-table-rate-shipping/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-easy-table-rate-shipping/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-easy-table-rate-shipping/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-easy-table-rate-shipping/reviews/)

## Tags

 * [fatal](https://wordpress.org/support/topic-tag/fatal/)

 * 1 reply
 * 2 participants
 * Last reply from: [merlinmonmouth](https://wordpress.org/support/users/merlinmonmouth/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-when-no-zone-set/#post-13072851)
 * Status: resolved