Skip to content

Instantly share code, notes, and snippets.

@JustinSainton
Created May 10, 2014 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustinSainton/2cc2727f131f3f95f47f to your computer and use it in GitHub Desktop.
Save JustinSainton/2cc2727f131f3f95f47f to your computer and use it in GitHub Desktop.
add_filter( 'wpsc_update_customer_meta', 'wpsc_single_target_market', 15, 2 );
add_filter( 'wpsc_get_customer_meta' , 'wpsc_single_target_market', 15, 2 );
function wpsc_single_target_market( $result, $key ) {
if ( $key !== 'shipping_country' && $key !== 'shippingcountry' ) {
return $result;
}
$countries = WPSC_Countries::get_countries_array();
if ( count( $countries ) !== 1 ) {
return $result;
}
$country = $countries[0];
return $country['isocode'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment