daralraqi
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: set country based on geolocation informationIm using this one now – however any clue to make the field readonly?
I dont want the client to change the location field if we set it automatically
.
Appreciate your help @alanfulleradd_action( ‘default_checkout_country’ , ‘set_user_geoip_country_as_default_checkout_country’, 900 );
function set_user_geoip_country_as_default_checkout_country( $default_country ) {
// Get an instance of the WC_Geolocation object class
$geolocation = new WC_Geolocation();
// Get user IP
$user_ip_address = $geolocation->get_ip_address();
// Get user geolocated data.
$user_geoip_data = $geolocation->geolocate_ip( $user_ip_address );if ( isset($user_geoip_data[‘country’]) && ! empty($user_geoip_data[‘country’]) ) {
$default_country = $user_geoip_data[‘country’]; // Set user geoIp country
}
//echo “The Default country is : “.$default_country;
if ($default_country !=null){return $default_country;
echo $default_country;
}
else {return ‘SA’;
}Forum: Fixing WordPress
In reply to: set country based on geolocation information@alanfuller would you please guide me on this?
Forum: Fixing WordPress
In reply to: set country based on geolocation information@alanfuller already have maxmind geolocate installed but cant find the variable that will redirects to the country code.
Forum: Fixing WordPress
In reply to: Create a user account on checkout without email or passwordI need to create a user without having his email or set him a password..
The only fields required is his mobile and first and last name..
How can We bypass the email and password requirements in registration
Thank you Ahmadalim @ahmadalim but that’s not what I was looking for ??