0

My client has multi website magento ecommerce portal eg www.xyz.com for US Store, www.xyz.com/ca/ for Canada.

Ive implemented the GeoIP plugin in Webserver which loads xyx.com for US customers and xyz.com/ca for Canada cusstomers. When Canada customers tries to navigate to US store via country selector, site is navigating to CA store due to server level GEO IP.

Now I need help to implement GEO IP functionality land to respective store based on GEO and also allow customer to navigate to Different store.

Kindly help

2
  • you have to redirect customers only if they visit default domain www.magento.com -> www.magento.com/en/us/ , if they change the store manually to www.magento.com/en/ca/ , so let them be there while their shopping, if they visit default domain again , lets redirect them to www.magento.com -> www.magento.com/en/us/ lenovo.com
    – MagenX
    Commented May 27, 2016 at 16:19
  • Don't know if that helps but we had a big struggle with that to trying different modules from third parties that did not work. I decided to implement it in varnish directly. See solution in this post: magento.stackexchange.com/questions/193766/… Since it is in Varnish, it is super fast and independent from the Magento version Commented Mar 21, 2018 at 14:12

1 Answer 1

-1

You could use a cookie to set the chosen store of each visitor. If no cookie is set Geo IP can direct to the store of the detected country, but when the customer manually chooses their country via the store selector set the cookie to their chosen store. Change the Geo IP code to only redirect to a certain store if this cookie is not set and if the cookie is set do not even try to detect the country, just redirect to the store they have chosen and that is identified in this cookie.

3
  • so if cookie is set they always have to use store selector?? what is the point of geoip here??
    – MagenX
    Commented May 26, 2016 at 8:30
  • Cookie is not a appropriate solution to this function. Commented May 27, 2016 at 5:47
  • @MagenX no by default the cookie is not set and the GeoIP sends them to the store for their country when they visit the plain domain (without a store code). If for any reason someone wants to change to a store for another country he can use the store switcher, that sets a cookie which basically tells the GeoIP lookup: "this person has manually chosen a store, don't try to detect their country anymore". This is how we set things up where I work and its working for us. Also in our case, the GeoIP only detects ppls country when they dont have store code in their URL.
    – PVL
    Commented May 27, 2016 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.