I am trying to make shipping costs with different cites in Georgia country.
I found this code:
function ace_change_city_to_dropdown( $fields ) {
$cities = array(
'Tbilisi',
'city2',
// etc …
);
$city_args = wp_parse_args( array(
'type' => 'select',
'options' => array_combine( $cities, $cities ),
), $fields['shipping']['shipping_city'] );
$fields['shipping']['shipping_city'] = $city_args;
$fields['billing']['billing_city'] = $city_args;
return $fields;
}
add_filter( 'woocommerce_checkout_fields', 'ace_change_city_to_dropdown' );
And I found woocommerce city rate shipping Where I can change city names with my desired cities. it's working fine.
But when there shipping costs (for example 5$) I want to hide free shipping checkbox.
How to hide free shipping when there shipping costs in WooCommerce?