global $woocommerce; if(!headers_sent()){
$billingcity = WC()->customer->get_billing_city(); // this line
if(empty($billingcity)){
if(isset($_COOKIE['set_my_city'])){
//setcookie('set_my_city', $city, time()+62208000, '/', $_SERVER['HTTP_HOST']);
}else{
WC()->customer->set_props(array('billing_city'=> 'Bangalore Rural'));
$billingcity = 'Bangalore Rural';
setcookie('set_my_city','Bangalore Rural', time()+62208000, '/', $_SERVER['HTTP_HOST']);
$billingcity = WC()->customer->get_billing_city(); error in this line