Jump to content

Recommended Posts

I see.

In this case, as far as I know Prestashop only provides the language code (en) without the country code (gb, us, etc).

I think you need to create a module for this (please, anybody correct me if I am mistaken!)

 

Now, are you looking for php to automaticaly recognize the  user country? Or do you want to set it from the back office? The second case will be easier to achieve, of course

Link to comment
Share on other sites

In this case, I suggest you create a list of the countries you want to support. Place them in an array

Then, in the module's back office, grasb all your languages (Language::getLanguages(true))

 

At this point, for each language, use another foreach loop to run through all countries and add them to a select box.

 

Basically, you want to assign a country to each language ID.

 

Save entries to a new table, like id_lang, id_country

 

 

Then, in the hook function you use to print out links, grab your settings. For each of them, you can assign the id_lang-id_country pair based on what you decide (i.e. the link you are displaying) :)

Link to comment
Share on other sites

  • 9 months later...

So If I paste this: 

                <link rel="alternate" hreflang="en" href="http://www.goodpsychologists.com/en/" />
                <link rel="alternate" hreflang="es" href="http://www.goodpsychologists.com/es/" />
 
In the head section of the header.tpl file in the theme/defaultbootstrap directory, do I solve the google requirement for having  my site in spanish and english?
 
 
Thank you
Edited by npr321 (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...