Skip to content

Instantly share code, notes, and snippets.

@cesjam7
Created November 28, 2021 01:13
Show Gist options
  • Save cesjam7/08f5a15ed611b745c36e3e6c129ab983 to your computer and use it in GitHub Desktop.
Save cesjam7/08f5a15ed611b745c36e3e6c129ab983 to your computer and use it in GitHub Desktop.
Renombrar, ordenar y eliminar estados de WooCommerce
<?php add_filter( 'woocommerce_states', 'c7_woocommerce_states' );
function c7_woocommerce_states( $states ) {
$states['PE'] = array(
'LMA' => 'Lima Metropolitana',
'AMA' => 'Amazonas',
'ANC' => 'Ancash',
'APU' => 'Apurímac',
'ARE' => 'Arequipa',
'AYA' => 'Ayacucho',
'CAJ' => 'Cajamarca',
'CAL' => 'Callao',
'CUS' => 'Cusco',
'HUV' => 'Huancavelica',
'HUC' => 'Huánuco',
'ICA' => 'Ica',
'JUN' => 'Junín',
'LAL' => 'La Libertad',
'LAM' => 'Lambayeque',
'LIM' => 'Lima Provincia',
'LOR' => 'Loreto',
'MDD' => 'Madre de Dios',
'MOQ' => 'Moquegua',
'PAS' => 'Pasco',
'PIU' => 'Piura',
'PUN' => 'Puno',
'SAM' => 'San Martín',
'TAC' => 'Tacna',
'TUM' => 'Tumbes',
'UCA' => 'Ucayali'
);
unset($states['PE']['CAL']);
return $states;
} ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment