Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wp wc php change customer shipping country for all users

$country_code = 'US';

// Get the WC_Customer instance object from user ID
$customer = new WC_Customer( $user_id );

$customer->set_billing_country( $country_code );
$customer->set_shipping_country( $country_code );
$customer->save();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #wp #wc #php #change #customer #shipping #country #users
ADD COMMENT
Topic
Name
2+3 =