I try this code buy seem it does not work :
function my_minimum_limit_shipping_rates_function( $rates, $package ) {
$shipping_minimum = 10; // The maximum amount would be $10.50
$only_apply_to_rates = array( ‘263021’, ‘flat_rate’ ); // Enter the shipping IDs here
// Loop through all rates
foreach ( $rates as $rate_id => $rate ) {
// Skip the shipping rates that are not in the list
if ( ! in_array( $rate_id, $only_apply_to_rates ) ) {
continue;
}
// Check if the rate is higher then a certain amount
if ( $rate->cost < $shipping_minimum ) {
$rate->cost = $shipping_minimum;
}
}
return $rates;
}
add_action( ‘woocommerce_package_rates’, ‘my_minimum_limit_shipping_rates_function’, 10, 2 );