WebSite X5Help Center

 
Michel M.
Michel M.
User

Site restrictions  en

Author: Michel M.
Visited 768, Followers 1, Shared 0  

Dear Sirs

Looking to get help plese.

As we are whoesaler serve only London , is there any way to restrect clients of purchase if they are outside london?

Hope to get help soon as it's realy an important matter

Kind regards

Posted on the
2 ANSWERS - 2 USEFUL
Claudio D.
Claudio D.
Moderator
Best User of the month IT

I hope you are on linux host...
if yes, you can do it by putting in the htaccess on your host
of instructions to allow only people from London to visit your site or your store folders , only.
everyone else you block them .
Or , better yet, with all pages in php,
you always redirect based on the visitor's IP ...
take a cue from here:
https://stackoverflow.com/questions/29088644/php-redirect-based-on-ip-addresses

Read more
Posted on the from Claudio D.
Stiac Engineering
Stiac Engineering
User

Interesting topic!

If instead of PHP you wanted to use JavaScript, you could use code that actually takes advantage of geographic location if you wanted, using actual GPS data you could use this code https://www.gebher.com/blog/index.php?redirect-based-on-geolocation

The operation is approximately simple, i.e. if the user is not within a kilometer radius, modifiable by us and from the headquarters of our business, he is redirected to an alert page to inform him appropriately.

I hope it can be useful.

Read more
Posted on the from Stiac Engineering