WebSite X5Help Center

 
Michel M.
Michel M.
User

Site restrictions  en

Auteur : Michel M.
Visité 1245, Followers 1, Partagé 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

Posté le
2 RéPONSES - 2 UTILE
Claudio D.
Claudio D.
Moderator
Meilleur utilisateur du mois 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

Lire plus
Posté le de 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.

Lire plus
Posté le de Stiac Engineering