The accepted answer no longer works with WooCommerce version 2.6. It still gives a way out, but this conclusion is erroneous because it does not use the newly entered delivery zones.
To get the minimum cost for free shipping in a specific area, try this function:
function get_free_shipping_minimum($zone_name = 'England') { if ( ! isset( $zone_name ) ) return null; $result = null; $zone = null; $zones = WC_Shipping_Zones::get_zones(); foreach ( $zones as $z ) { if ( $z['zone_name'] == $zone_name ) { $zone = $z; } } if ( $zone ) { $shipping_methods_nl = $zone['shipping_methods']; $free_shipping_method = null; foreach ( $shipping_methods_nl as $method ) { if ( $method->id == 'free_shipping' ) { $free_shipping_method = $method; break; } } if ( $free_shipping_method ) { $result = $free_shipping_method->min_amount; } } return $result; }
Put the above function in functions.php and use it in the template as follows:
$free_shipping_min = '45'; $free_shipping_en = get_free_shipping_minimum( 'England' ); if ( $free_shipping_en ) { $free_shipping_min = $free_shipping_en; } echo $free_shipping_min;
Hope this helps someone.
D. visser
source share