salko Posted April 1, 2011 Share Posted April 1, 2011 I have Prestashop 1.4 and I noticed a strange behaviour with languages: when I am on the main page I can change the language with no problems, but when I go to a product page, I cannot change to the different language; if I click other language, nothinh happens. So is this some kind of a bug or maybe some kind of a feature in PS?? Link to comment Share on other sites More sharing options...
shokinro Posted April 2, 2011 Share Posted April 2, 2011 I just check my demo site is works fine. You can see it here http://expresscheckout.dyndns.org:8080/shop1417/product.php?id_product=8&id_lang=4Please make sure you have created the data for different languages. If you have only input data for one language, then even you click the language, it will display the same data, so you will fell nothing changed.You have to input different data for name/description at product detail page of back office.Please click language icon (usually it is a flag icon), then select different language to input data for different language. Link to comment Share on other sites More sharing options...
salko Posted April 2, 2011 Author Share Posted April 2, 2011 I forgot to mention that this only happens when I have friendly URLs enabled, if I disable it then switching different languages in a priduct page works fine ... And yes, I know it sould be entered the data for all languages, if not then default language is used ... But when I click to a different language icon (flag) nothing happens, even these flags do not switch, so ... Link to comment Share on other sites More sharing options...
shokinro Posted April 2, 2011 Share Posted April 2, 2011 I just tried it with SEO friendly URL enabled, it is also working fine.You can see it here http://prestashop-addons.com/shop1417/Is there any error happened when you click the language?You can try set "display_errors" to 'on" to check itPlease also check link URL of language icons are correctly.it should be something like belowhttp://prestashop-addons.com/shop1417/es/portatiles-apple/6-macbook.htmlAlso please check this1. clear compile/cache folder to smarty (if you are using version 2, the folder name is smarty_2) /tools/smarty/compile /tools/smarty/cache2. clear your browser cache Link to comment Share on other sites More sharing options...
salko Posted April 5, 2011 Author Share Posted April 5, 2011 I see than on your page it works correctly, on mine it works only if I disable friendly URLs.I have enabled 'display_errors' but I see no errors. Where I should see these errors, if any?URLs of language icons are correct.I cleared compile and cache folder of smarty.I cleared web browser cache.Still no success, I find out that switching languages doesn't work only when I am on product page, if I am on main page, categories page, subcategories page, and any other pages language switching works normally ... Please help! Link to comment Share on other sites More sharing options...
shokinro Posted April 5, 2011 Share Posted April 5, 2011 have you tried to re-generate the .htaccess file?I think maybe the rewrite rules is not generated correctly. Link to comment Share on other sites More sharing options...
salko Posted April 6, 2011 Author Share Posted April 6, 2011 have you tried to re-generate the .htaccess file?I think maybe the rewrite rules is not generated correctly. Already tried to regenerate it several times, but no success ... Link to comment Share on other sites More sharing options...
Zbigniew Szalbot Posted April 6, 2011 Share Posted April 6, 2011 have you tried to re-generate the .htaccess file?I think maybe the rewrite rules is not generated correctly. Already tried to regenerate it several times, but no success ... I can confirm the same thing happens to me (and not only to me). The problem appeared after I had switched friendly URLs on. I am also looking for a solution to this. Thanks! Link to comment Share on other sites More sharing options...
Timothy Jarman Posted April 10, 2011 Share Posted April 10, 2011 spent the last 2 hours trying to get this working, i have same problem. I have never had so many problems with a shop upgrade in my life. i have many languages and i can change them everywhere on the site except when im on a product page.Soon as i click a flag it will direct to the correct url i.e. if its latvian then /lv/, but the it will instantly switch back to the language i was just on.If i delete this line from the htaccess then it works, but im no expert and i would think that this is important to keep -- RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /FAKEDIR/product.php?id_product=$1 [QSA,L]Any ideas?? Link to comment Share on other sites More sharing options...
jinxer Posted April 16, 2011 Share Posted April 16, 2011 The solution from Timothy also worked for me. As far as I can see there is no difference in the behaviour of the webshop.Anyone who knows if there will be a problem with that line in .htaccess removed?? Link to comment Share on other sites More sharing options...
Zbigniew Szalbot Posted April 20, 2011 Share Posted April 20, 2011 I do know what if it causes issues - I haven't noticed any and removing this line helps me as well. Link to comment Share on other sites More sharing options...
Timothy Jarman Posted April 23, 2011 Share Posted April 23, 2011 i have just tried the new prestashop update and i still have this issue, please prestashop can you help us Link to comment Share on other sites More sharing options...
Timothy Jarman Posted April 28, 2011 Share Posted April 28, 2011 someone please please help. Not only can i now change products but on my site, now i cant even view new products or specials, i dont understand why. Please help Link to comment Share on other sites More sharing options...
salko Posted May 1, 2011 Author Share Posted May 1, 2011 spent the last 2 hours trying to get this working, i have same problem. I have never had so many problems with a shop upgrade in my life. i have many languages and i can change them everywhere on the site except when im on a product page.Soon as i click a flag it will direct to the correct url i.e. if its latvian then /lv/, but the it will instantly switch back to the language i was just on.If i delete this line from the htaccess then it works, but im no expert and i would think that this is important to keep -- RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /FAKEDIR/product.php?id_product=$1 [QSA,L]Any ideas?? I do not have this line in .htaccess ... So has anyone found a fix for this?? It's really annoying bug ... Link to comment Share on other sites More sharing options...
cybeardjm Posted May 8, 2011 Share Posted May 8, 2011 Same problem here on a brand new 1.4.1.0On an other directory + DB on the same server, I did 2 default scratch installations and the problem doesn't exist.I'd say then, that some changes at some point in the global configuration of PS, "break" this "normal" behavior, but I don't know what... unfortunately.I can confirm that commenting the line in .htaccess does indeed work (.htaccess generated automatically from the PS Tools).For those who haven't seen the problem and want to check : go to http://www.onlinevoyages.com, choose any product, try 2 switch language between FR/EN. Same problem if you start with FR or EN.If you change language on the home page or any CMS page or any category page, it works fine. Only product pages generate this problem.sincerelyDJM Link to comment Share on other sites More sharing options...
Thurdan Posted May 16, 2011 Share Posted May 16, 2011 same problem for me, since I installed shop manager and tried to import/export... Link to comment Share on other sites More sharing options...
zyko Posted May 16, 2011 Share Posted May 16, 2011 It works OK to me as well.Did anybody who having the prob, tried to check the error log file ???ThanksDelonix Link to comment Share on other sites More sharing options...
Thurdan Posted May 16, 2011 Share Posted May 16, 2011 Hi Delonix,Please could you tell me where is located this log file?Tnx Link to comment Share on other sites More sharing options...
zyko Posted May 16, 2011 Share Posted May 16, 2011 error log file is on server root directoryhowever you can chk for any error if it exists by displaying error on the browser by chnaging the settingini_set(‘display_errors’, ‘off’)toini_set(‘display_errors’, ‘on’)in file config/config.inc.php Link to comment Share on other sites More sharing options...
zyko Posted May 16, 2011 Share Posted May 16, 2011 don't forget to add the following lineerror_reporting(E_ALL | E_STRICT);after ini_set(‘display_errors’, ‘on’) Link to comment Share on other sites More sharing options...
Thurdan Posted May 16, 2011 Share Posted May 16, 2011 - not found such a file on the root of the server ...- no error reported by the browser ... Link to comment Share on other sites More sharing options...
shokinro Posted May 16, 2011 Share Posted May 16, 2011 - not found such a file on the root of the server I think the log may not be under the root of your PrestaShop root. It could be under more higher level folder that hold logs. Link to comment Share on other sites More sharing options...
Thurdan Posted May 16, 2011 Share Posted May 16, 2011 I solved the problem ! (at least my problem)I discovered that only 1 product wrongly configurated is enough to provoke this problem.In my case, using an import software, a few products were created with a wrong default category assignment (product assigned to one category, different than the default category).Hope it will help other people Link to comment Share on other sites More sharing options...
shokinro Posted May 16, 2011 Share Posted May 16, 2011 thanks for sharing the information. it is very good information and will be very helpful to others. Link to comment Share on other sites More sharing options...
holden321 Posted September 1, 2011 Share Posted September 1, 2011 Any product in the home cat has this problem Link to comment Share on other sites More sharing options...
webplus Posted September 29, 2011 Share Posted September 29, 2011 Hello, I had the same problem and the fix posted here works for me: http://www.prestashop.com/forums/topic/118466-solved-language-selector-not-working-on-product-details-pages/ Here is the link with 2 highlighted lines that needs to be deleted in /classes/Tools: http://scm.prestashop.com/viewrep/PrestaShop_v.1.4.x/classes/Tools.php?r1=7849&r2=7852 Then regenerate .htaccess Link to comment Share on other sites More sharing options...
ijasnijas Posted February 15, 2012 Share Posted February 15, 2012 Hello, I had face this error and fixed it. Follow me. There is a line in .htacces file like RewriteRule ^[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L] I had change that to RewriteRule ^[a-zA-Z0-9-]{3,}/([0-9]+)\-[a-zA-Z0-9-]*\.html /product.php?id_product=$1 [QSA,L] Now it's working fine. Link to comment Share on other sites More sharing options...
Recommended Posts