// Need enable geolocation in Woocomerce settings // Check if user is in Europe function get_user_geo_continent () { $location = WC_Geolocation::geolocate_ip(); $country = $location['country']; // Get the country code $WC_Countries = new WC_Countries(); // Get WC_Countries instance object $continent = $WC_Countries->get_continent_code_for_country( $country ); // Get continent return $continent; } // Do something only for users in Europe if ( get_user_geo_continent() !== 'EU' ) { return; };