Jump to content

I want to redirect my customer to specific shop from geoip

Recommended Posts

Hello guys,

I post this message because I am stuck on a development that has the base seemed uncomplicated.

I have a PrestaShop 1.6 with two shops.

The first corresponds to North America (USA, Canada) and the second corresponds to Europe.

I did not find anything in the back office to automatically redirect the user to a specific shop, depending on his country. If it's possible, do not hesitate to explain to me how.

So I tried to develop that on my side, but nothing to do, I can not find the right file to do that.

I tried in: config/config.inc.php, I can differentiate the country from the client with GeoIP, but it is not appropriate to modify this file.

So I try to modify the initialize function of the Shop class. But at this point, I am already redirected to my "shop" by default.

I see in the .htaccess that there are the records of my two shops, would it be he who does the redirection, stupidly, in the order of presence in this file?

If it is, it is problematic.

In any case, I take any help, or track to be able to redirect to the right shop, depending on the country.

Thank you,

Share this post

Link to post
Share on other sites
  • 1 month later...

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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More