If the option “Hide other shipping methods when free shipping is available” is not displayed, you can achieve this behavior manually or by adding custom code.

Option 1: Use predefined rules

  1. Go to WooCommerce > Settings > Shipping and select your shipping zone.
  2. Configure:
    • A Free Shipping method with a minimum order of 60 euros.
    • A Flat Rate Shipping method with a base cost of 5 euros.
  3. While WooCommerce may not automatically hide the flat rate, customers will be able to choose free shipping when eligible.

Option 2: Use custom code

Add this code to your functions.php file to automatically hide other shipping methods when free shipping is available:

add_filter( 'woocommerce_package_rates', 'hide_shipping_methods_when_free_is_available', 100 );
function hide_shipping_methods_when_free_is_available( $rates ) {
$free = array();
foreach ( $rates as $rate_id => $rate ) {
if ( 'free_shipping' === $rate->method_id ) {
$free[ $rate_id ] = $rate;
break;
}
}
return ! empty( $free ) ? $free : $rates;
}

Final Step

  • Save your changes and refresh the checkout page to test