I want to add a dropdown for woocommerce cities.
I find a code for adding states as dropdown, but i dont know how to do this for cities. I try to make an analogy but it doesnt work.
Also, if posible i would like to shop cities based on the states, so i need a condition: if state = X then show this cities
The code for states was this:
add_filter( 'woocommerce_states', 'custom_woocommerce_states' );
function custom_woocommerce_states( $states ) {
$states['RO'] = array(
'TL' => 'Tulcea',
'VS' => 'Vaslui',
'VL' => 'Valcea',
'VN' => 'Vrancea'
);
return $states;
}