Jump to content

User origin


Eros eros

Recommended Posts

Hi,

Yes, it's possible to detect the country of origin of a user visiting your website.

You can integrate MaxMind (GeoIP2) library with PrestaShop to automatically detect the user's country.

You can use the server's ability to detect the visitor's IP address and pass it through a custom-built solution that uses an IP database (such as MaxMind GeoLite) to determine the country.

$ip = $_SERVER['REMOTE_ADDR']; // Get user's IP address
$country = geoip_country_name_by_name($ip); // Use GeoIP or a similar service to get the country
echo $country;

Regards.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...