I solved it by pasting this code into child theme’s functions.php file. It sets the shipping fees for all shipping methods to 0.
function filter_woocommerce_package_rates( $rates, $package ) {
// Cart total amount (integer)
$cart_total = WC()->cart->cart_contents_total;
// Greater than or equal to
if ( $cart_total >= 59.99 ) {
foreach ( $rates as $rate_key => $rate ) {
// For "free shipping" method (enabled), remove it
if ( $rate->method_id == 'free_shipping' ) {
unset( $rates[$rate_key] );
// For other shipping methods
} else {
// Append rate label titles (free)
$rates[$rate_key]->label .= ' ' . __( '(free)', 'woocommerce' );
// Set rate cost
$rates[$rate_key]->cost = 0;
// Set taxes rate cost (if enabled)
$taxes = array();
foreach ( $rates[$rate_key]->taxes as $key => $tax ) {
if ( $rates[$rate_key]->taxes[$key] > 0 ) {
$taxes[$key] = 0;
}
}
$rates[$rate_key]->taxes = $taxes;
}
}
}
return $rates;
}
add_filter( 'woocommerce_package_rates','filter_woocommerce_package_rates', 10, 2 );