Skip to content

Instantly share code, notes, and snippets.

@rynaldos-zz
Last active July 2, 2020 05:21
Show Gist options
  • Select an option

  • Save rynaldos-zz/6893f3e3d8d39cdd457e3373c9f1358c to your computer and use it in GitHub Desktop.

Select an option

Save rynaldos-zz/6893f3e3d8d39cdd457e3373c9f1358c to your computer and use it in GitHub Desktop.
[WooCommerce 3.0] Add Northern Ireland to shipping zones
// https://gist.github.com/WillBrubaker/b9b2415e32a19833aa9c8b1845f64489
add_filter( 'woocommerce_countries', 'handsome_bearded_guy_add_my_country' );
function handsome_bearded_guy_add_my_country( $countries ) {
$new_countries = array(
'NIRE' => __( 'Northern Ireland', 'woocommerce' ),
);
return array_merge( $countries, $new_countries );
}
// https://gist.github.com/WillBrubaker/8194416832c358e44168897f942dd0ef
add_filter( 'woocommerce_continents', 'handsome_bearded_guy_add_my_country_to_continents' );
function handsome_bearded_guy_add_my_country_to_continents( $continents ) {
$continents['EU']['countries'][] = 'NIRE';
return $continents;
}
// Kudos to https://gist.github.com/WillBrubaker for the original snippets
// Did this help? Donate me some BTC: 1BEsm8VMkYhSFJ92cvUYwxCtsfsB2rBfiG
@umer45
Copy link
Copy Markdown

umer45 commented Feb 6, 2018

Can we add more than one countriess through this ??? If yes can help me with that ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment