NaveenYadav Posted January 2, 2014 Share Posted January 2, 2014 Hello All, I have a store in 3 language (English, french, Spanish). I want set user country based default languages. If any visitor/customer comes from French then shop default language must set to french. And If any visitor/customer comes from Spanish then shop default language must set to Spanish. And for rest others default shop language must be English. I am trying to changes in cookie class files. but exactly not getting what to change. So please help me what to do and how to do. Link to comment Share on other sites More sharing options...
walidon Posted January 2, 2014 Share Posted January 2, 2014 (edited) As far as my short experience with prestashop, I think that it detects automatically the language according to the language of the browser used! here is the link how to do that. https://github.com/PrestaShop/PrestaShop/pull/178 But you have to set a default language in case the language of your visitor isn't provided in your case you want English and that can be done in the BO, go to localization tab -> localization -> configuration there you can set the default language! Edited January 2, 2014 by walidon (see edit history) 1 Link to comment Share on other sites More sharing options...
NaveenYadav Posted January 2, 2014 Author Share Posted January 2, 2014 Thanks for Reply, But I want this option by detecting visitor country(IP Based). So any solution for this? Link to comment Share on other sites More sharing options...
walidon Posted January 2, 2014 Share Posted January 2, 2014 I see no need for that But if you insist, go to préférences-geolocalization and see what can be useful for you. there are free modules for setting default language and currency, search for them. All the best 1 Link to comment Share on other sites More sharing options...
NaveenYadav Posted January 2, 2014 Author Share Posted January 2, 2014 There is nothing to set in geolocalization. And no such free module. Any other solution? Link to comment Share on other sites More sharing options...
walidon Posted January 2, 2014 Share Posted January 2, 2014 (edited) Dear friend, I will try to explain to you in détails: Your shop is in 3 lgges; English, Spanish and French. If a visitor from France comes to your shop and he is using an operating system in french language (whether Windows, Mac, Linux, Tablette, Ipads or any device working with an operating system) and his browser too is in french; then your shop automatically detects the french language and provides to that visitor the french version of your site. let say that someone from any other country in the world using the same configuration as your french visitor (the french languae in his device) then he as well will get your french version of the site. the same applies to the Spanish language, where the Spanish version of your site will be given to those visitors who al configurations are in spanish language. Now lets say that a visitor who has chinese, japanese , portugese, arabic, italian or any language apart from French and Spanish come to visit your shop, then the English version will be given to them. But if you assign IPs, then lets say that someone from France comes, he will be served french language, but what about other countries who use french as their language too? the same applies to spanish. Hope you got the idea. Sorry I can't help you more in this:) as I don't know the answer. Edited January 2, 2014 by walidon (see edit history) 1 Link to comment Share on other sites More sharing options...
NaveenYadav Posted January 2, 2014 Author Share Posted January 2, 2014 Thanks walidon, any other solution? Link to comment Share on other sites More sharing options...
NaveenYadav Posted January 3, 2014 Author Share Posted January 3, 2014 (edited) ok, But when I changed my browser language to french and then open site, it still loading in English (English is selected as default) don't know why? Edited January 3, 2014 by NaveenYadav (see edit history) Link to comment Share on other sites More sharing options...
NaveenYadav Posted January 3, 2014 Author Share Posted January 3, 2014 any guesses? Link to comment Share on other sites More sharing options...
El Patron Posted January 3, 2014 Share Posted January 3, 2014 ok, But when I changed my browser language to french and then open site, it still loading in English (English is selected as default) don't know why? did you clear your browser cookies? PS cookie remembers the last language selected so you must clear the cookie. Link to comment Share on other sites More sharing options...
NaveenYadav Posted January 6, 2014 Author Share Posted January 6, 2014 yes, I have cleared my browser's cookies and cache. Link to comment Share on other sites More sharing options...
El Patron Posted January 6, 2014 Share Posted January 6, 2014 yes, I have cleared my browser's cookies and cache. could you provide your shop url? Link to comment Share on other sites More sharing options...
gilsimjo Posted March 28, 2014 Share Posted March 28, 2014 Hello I'm interested in this thread, do you mean that prestashop sets language depending of the browser language??? I have my browser in english and it shows my shop in Spanish which is my default language.... Is there any special configuration to get browser's language in prestashop? Thanks for your help. Link to comment Share on other sites More sharing options...
walidon Posted March 30, 2014 Share Posted March 30, 2014 read my post #2 for more information or just a quick search will give you many info. Link to comment Share on other sites More sharing options...
El Patron Posted March 30, 2014 Share Posted March 30, 2014 Hello I'm interested in this thread, do you mean that prestashop sets language depending of the browser language??? I have my browser in english and it shows my shop in Spanish which is my default language.... Is there any special configuration to get browser's language in prestashop? Thanks for your help. Please post front office url and your prestashop version. ps supports browse lang detect in 1.5.6 and above. Link to comment Share on other sites More sharing options...
El Patron Posted August 11, 2014 Share Posted August 11, 2014 Just a follow up to this. you do not want to use Geo Localization, geolitecity.dat file is only around 85% accurate, the other 15% will be forbidden (native PrestaShop behavior) to shop. So don't use. While browser detection in 1.5.6 and higher was a good move, it does not support scenario of 'I prefer Danish, but will accept the following language) in HTTP_ACCEPT_LANGUAGE. In other words native PrestaShop will look at first language in HTTP_ACCEPT_LANGUAGE but if not defined in shop, use default without looking for other visitor browser languages. Localization has always been of interest to me and important for my customers. Here is the most advanced language detector, on the planet. [Module] Geo Localization - Advanced Browser Language Detect Link to comment Share on other sites More sharing options...
Recommended Posts