I have the following code which limits the provinces to Valencia (Spain) only, in WooCommerce:
add_filter( 'woocommerce_states', 'tl45r_custom_woocommerce_states' );
function tl45r_custom_woocommerce_states( $states ) {
// Only show specific provinces (Madrid - MD and Barcelona - B) for Spain (ES)
$states['ES'] = array(
//'MD' => __( 'Madrid', 'woocommerce' ),
//'B' => __( 'Barcelona', 'woocommerce' ),
'V' => __( 'Valencia', 'woocommerce' ),
);
return $states;
}
However, I want this limitation only be applied to the shipping field but not the billing field.
How can I do this?