Jump to content

Geolocation


Go to solution Solved by newbie LAC,

Recommended Posts

Posted

Hey IPS,

What is the best way to grab the location of a forum visitor? This is what we are trying to come up with. So we have products in the Store on our forum. The only payment method to buy these products are via PayPal. Some of these products have recurring charges, so the package gets renewed every 30 days, 90 days, or 180 days. However, if the individual lives in Germany, they have PayPal restrictions that prevent them from purchasing recurring products. So I want to grab the location of the user, if they are in Germany then I want to display a message on the store index stating the PayPal restrictions and to only buy the non-recurring products. What is the best way to accomplish this task? Looking forward to your advice.

Thanks in advance. 
Aaron

Posted
7 hours ago, newbie LAC said:

Hello,


try
{
	$geoData = \IPS\GeoLocation::getByIp( \IPS\Member::loggedIn()->ip_address );
	
	if ($geoData['country'] == 'DE')
	{
		// Show message
	}
}
catch ( \Exception $e )
{
}

 

This does the trick! Thanks for helping out!

Posted
20 hours ago, teraßyte said:

Do note that the IPS Geolocation service works only as long as your license is active. If for whatever reason the license is expired it won't retrieve the geolocation.

Noted. I will pass this on to my other forum admins. Thanks

Posted
20 hours ago, teraßyte said:

Do note that the IPS Geolocation service works only as long as your license is active. If for whatever reason the license is expired it won't retrieve the geolocation.

Noted. I will pass this on to my other forum admins. Thanks

  • 3 years later...
Posted
On 12/22/2016 at 9:03 AM, newbie LAC said:

Hello,


try
{
	$geoData = \IPS\GeoLocation::getByIp( \IPS\Member::loggedIn()->ip_address );
	
	if ($geoData['country'] == 'DE')
	{
		// Show message
	}
}
catch ( \Exception $e )
{
}

 

Does the built in GeoLocation method return the latitude and longitude by IP?

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...