php - woocommerce base location condition to match current user location -


i on this

basically have condition set customers outside base location in woocommerce

for instance, base location united kingdom

so how make condition this

if (user) = united kingdom { echo 'customer in uk'; } else { echo 'customer outside uk'; } 

thanks

also how use this;

wc_get_customer_default_location() wc_get_base_location()

currently got , not working

$country_match = wc_get_customer_default_location(); echo 'your location ' . $country_match['country'] . '<br>';  if ( $country_match ) {     $default = wc_get_base_location();     if ( $default['country'] !== $country_match ) {         echo 'country match<br>';     } else {          echo 'country not match<br>'; }      if ( $default['state'] && $default['state'] !== $state ) {         echo 'state match';     } else { echo 'state not match'; } } else {     echo 'false';     } 


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -