rssurvivor Posted November 20, 2010 Share Posted November 20, 2010 Many of the larger web shops using prestashop have multiple domain focusing on different markets. There are several modules that allow for geolocation based on the customer IP, but when multiple domains are available it is a lot more practical to do translations based on them.For example, say my shop is called megashop, I have two domains:megashop.com which is englishmegashop.nl which is dutchI also have two translations files which have both an iso code and a lang_id assigned. So we have the following values:for the .nl: iso = nl and lang_id = 5 for the .com: iso = en and lang_id = 1 Off course if you have more domains, more iso,domain and lang_id combination are possible.The plan now is, getting the .com domain to switch the language to lang_id =1 and the .nl domain to lang_id = 5.What we first do is explode the domain to get a value for the TLD (top level domain) $domainarray = explode('.', $_SERVER['HTTP_HOST']); $TLD = $domainarray[count($domainarray)-1]; This code returns either com or nl in this example.Up until this point I could still make everything work. However when trying to make the transition from the domain to the lang_id and iso I ran in to trouble. I tried disabling all language related things from the init.php and commenting out the loading of the lang_id from a cookie, but I just couldn't figure out what to change to make it work uit.Can anyone help out? Link to comment Share on other sites More sharing options...
adamus007p Posted February 16, 2011 Share Posted February 16, 2011 http://www.prestashop.com/forums/viewthread/34988/general_discussion/a_domain_which_redirect_straight_to_a_language_versionhttp://www.prestashop.com/forums/viewthread/87256/development/solved_chosing_language_by_domain_and_not_by_cookie Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now