Skip to content

Instantly share code, notes, and snippets.

@kontikidigital
Created March 14, 2023 10:29
Show Gist options
  • Save kontikidigital/0781a70f14abc929dfbbd5f3c792e236 to your computer and use it in GitHub Desktop.
Save kontikidigital/0781a70f14abc929dfbbd5f3c792e236 to your computer and use it in GitHub Desktop.
WooCommerce - Customize States for Spain
<?php
/**
* Customize States for Spain
*/
add_filter( 'woocommerce_states', 'tgt_woocommerce_states' );
function tgt_woocommerce_states( $states ) {
$states['ES'] = array(
'La Coruña' => __( 'La Coruña', 'woocommerce' ),
'Álava' => __( 'Álava', 'woocommerce' ),
'Albacete' => __( 'Albacete', 'woocommerce' ),
'Alicante' => __( 'Alicante', 'woocommerce' ),
'Almería' => __( 'Almería', 'woocommerce' ),
'Asturias' => __( 'Asturias', 'woocommerce' ),
'Ávila' => __( 'Ávila', 'woocommerce' ),
'Badajoz' => __( 'Badajoz', 'woocommerce' ),
'Baleares' => __( 'Baleares', 'woocommerce' ),
'Barcelona' => __( 'Barcelona', 'woocommerce' ),
'Burgos' => __( 'Burgos', 'woocommerce' ),
'Cáceres' => __( 'Cáceres', 'woocommerce' ),
'Cádiz' => __( 'Cádiz', 'woocommerce' ),
'Cantabria' => __( 'Cantabria', 'woocommerce' ),
'Castellón' => __( 'Castellón', 'woocommerce' ),
'Ceuta' => __( 'Ceuta', 'woocommerce' ),
'Ciudad Real' => __( 'Ciudad Real', 'woocommerce' ),
'Córdoba' => __( 'Córdoba', 'woocommerce' ),
'Cuenca' => __( 'Cuenca', 'woocommerce' ),
'Gerona' => __( 'Gerona', 'woocommerce' ),
'Granada' => __( 'Granada', 'woocommerce' ),
'Guadalajara' => __( 'Guadalajara', 'woocommerce' ),
'Guipúzcoa' => __( 'Guipúzcoa', 'woocommerce' ),
'Huelva' => __( 'Huelva', 'woocommerce' ),
'Huesca' => __( 'Huesca', 'woocommerce' ),
'Jaén' => __( 'Jaén', 'woocommerce' ),
'La Rioja' => __( 'La Rioja', 'woocommerce' ),
'Las Palmas' => __( 'Las Palmas', 'woocommerce' ),
'León' => __( 'León', 'woocommerce' ),
'Lérida' => __( 'Lérida', 'woocommerce' ),
'Lugo' => __( 'Lugo', 'woocommerce' ),
'Madrid' => __( 'Madrid', 'woocommerce' ),
'Málaga' => __( 'Málaga', 'woocommerce' ),
'Melilla' => __( 'Melilla', 'woocommerce' ),
'Murcia' => __( 'Murcia', 'woocommerce' ),
'Navarra' => __( 'Navarra', 'woocommerce' ),
'Orense' => __( 'Orense', 'woocommerce' ),
'Palencia' => __( 'Palencia', 'woocommerce' ),
'Pontevedra' => __( 'Pontevedra', 'woocommerce' ),
'Salamanca' => __( 'Salamanca', 'woocommerce' ),
'Santa Cruz de Tenerife' => __( 'Santa Cruz de Tenerife', 'woocommerce' ),
'Segovia' => __( 'Segovia', 'woocommerce' ),
'Sevilla' => __( 'Sevilla', 'woocommerce' ),
'Soria' => __( 'Soria', 'woocommerce' ),
'Tarragona' => __( 'Tarragona', 'woocommerce' ),
'Teruel' => __( 'Teruel', 'woocommerce' ),
'Toledo' => __( 'Toledo', 'woocommerce' ),
'Valencia' => __( 'Valencia', 'woocommerce' ),
'Valladolid' => __( 'Valladolid', 'woocommerce' ),
'Vizcaya' => __( 'Vizcaya', 'woocommerce' ),
'Zamora' => __( 'Zamora', 'woocommerce' ),
'Zaragoza' => __( 'Zaragoza', 'woocommerce' ),
);
return $states;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment