I have this code which remove some States from the Billing and Shipping form in the checkout page. It works fine.
I need to remove the State but JUST in the "shipping form". Then the removed 'states' should be shown in the 'billing form'
I guess I need to use another hook than 'woocommerce_states'. But no sure which one.
function remove_my_states ($states) {
unset ($states ['ES'] ['TF']);// tenerife
unset ($states ['ES'] ['GC']);// gran canaria
unset ($states ['ES'] ['CE']);// ceuta
unset ($states ['ES'] ['ML']); // melilla
unset ($states ['ES'] ['PM']); // baleares
return $states;
}
add_filter ('woocommerce_states', 'remove_my_states');