Last active
November 2, 2021 03:35
-
-
Save rynaldos/5000e16fb8b331a035d83f453d8d8591 to your computer and use it in GitHub Desktop.
Add England, Wales, Scotland, and Northern Ireland to WooCommerce shipping zones
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'woocommerce_countries', 'rs_add_my_country' ); | |
function rs_add_my_country( $countries ) { | |
$new_countries = array( | |
'NIRE' => __( 'Northern Ireland', 'woocommerce' ), | |
'SCO' => __( 'Scotland', 'woocommerce' ), | |
'WAL' => __( 'Wales', 'woocommerce' ), | |
'ENG' => __( 'England', 'woocommerce' ), | |
); | |
return array_merge( $countries, $new_countries ); | |
} | |
add_filter( 'woocommerce_continents', 'rs_add_my_country_to_continents' ); | |
function rs_add_my_country_to_continents( $continents ) { | |
$continents['EU']['countries'][] = 'NIRE'; | |
$continents['EU']['countries'][] = 'SCO'; | |
$continents['EU']['countries'][] = 'WAL'; | |
$continents['EU']['countries'][] = 'ENG'; | |
return $continents; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment