Jump to content

[Solved] Language Selector not working on Product Details Pages


Recommended Posts

Using PrestaShop v.1.4.3.0 & unmodified PrestaCart template

On the Products Details page, the language selector doesn't change the language from English to French, or French to English.

When hovering on the flag, it shows the correct URL - just the switch isn't happening when clicking on the flag.

It works on all other pages, only affects the Product Details Page

Link to comment
Share on other sites

Hi;
I have same. Its a reported BUG. It a htaccess issue.
I fixed it

open /modules/blocklanguages/blocklanguages.tpl line 35 (ps v1.4.3)
Change all line to following




thats all
Simply i added ?isolang={$language.iso_code} GET variable. It wont seems as SEF url but is not more serious than languages.

Good luck.

Link to comment
Share on other sites

Thank you, Mahmutta. That did the trick to get by for now; but unfortunately, I'll need the SEF urls to work. I checked the bug tracker, but couldn't find the ticket so I can monitor for solutions / fixes. Would you know which ticket it is?

Thanks!

Link to comment
Share on other sites

  • 2 weeks later...

I think I figured it out when the error occurs. If the item is saved in the home category the rewritten url is yourdomain.tld/lang/item.html (without a category name) and the language switcher won't work on product detail pages.

 

But if the item is saved in a subcategory and the url is yourdomain.tdl/category/lang/item.html the language switcher works (even if you check the home category later)

 

Example:

Item was saved in home category

http://cinemagie.de/de/5-radieschen-von-unten.html

 

language switcher won't work

 

Item was saved in a sub category and the url includes the category name then the language switcher works

http://cinemagie.de/en/filmplakate/2-the-tattooed-one.html

Link to comment
Share on other sites

  • 2 weeks later...

Maxence de Flotte has posted a fix. There are two lines of code to remove from classes/Tools.php

 

http://scm.prestashop.com/viewrep/PrestaShop_v.1.4.x/classes/Tools.php?r1=7849&r2=7852

 

make sure to clear the cache and browser cache then the language switcher will work on all product detail pages!

 

This did the work! Thx

 

P.S.: Better way is to override Tools.php. And also don't forget to generate a new htaccess file! ;-)

Link to comment
Share on other sites

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