Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

multi language store - $languages_id not set or lost


abra123cadabra

Recommended Posts

Hi @ll,

 

now this is a strange thing happening and I don't even know when my shop started to behave like this. I know it worked perfectly well with PHP4 and MS 2.2 (now non-SSL pages use PHP5, SSL pages are still on PHP4). I added some of the bugfixes but didn't upgrade completely to RC1.

 

Here is an example:

 

http://www.finefoods24.com/catalog/index.php uses http://www.oscommerce.com/community/contri...rch,extra+pages with text stored in the database in German and English. Switching from English to German (language flags in the footer) changes the rest of the page by using the correct language definition from /catalog/includes/languages/... but the language specific bit stored in the database is not changed according to the selected language.

 

I checked and found that the session superglobal $language is set correctly to "german" or "english" but $languages_id is not set properly (should be 1 for English and 2 for German).

 

Another example where things go wrong is on the product info pages like http://www.finefoods24.com/catalog/hanuta-...itte-p-243.html Clicking on the German language flag (my default language is English) changes the includes/languages/ file but the product description is still English. Clicking again on the German flag and the product description is displayed in German (this is also the time when the superglobals are $language = german and $language_id = 2).

 

Continuing to click on other links brings up German product pages but when I select "aisles" (the categories), it's only English again and this won't change not matter how many times I select the German language flag.

 

Obviously $languages_id is only updated to the correct value when ?language=de is added to the page URL but this gets "lost" when you continue to browse through the shop.

 

I'm not sure if I explained it so that it's possible to give me a hint to the correct file to fix the problem.

 

Any help is much appreciated.

 

abra

The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Link to comment
Share on other sites

So now I spent the whole afternoon trying to figure out what is going wrong and just after writing my post, I discovered the culprit of my worries. Just a tiny if statement that read: if ($language_id = '1') instead of $language_id == '1' in index.php.

 

Thanks anyway for reading.

 

abra

The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Link to comment
Share on other sites

I took a look at your site and was wondering, cause I couldn't exactly reproduce the mentioned behaviour. Since it was nothing I could understand very quickly, I've put that issue in the queue to look into it later on.

 

But I'm glad you figured out what was wrong.

Link to comment
Share on other sites

Thanks for looking anyway.

 

I got pretty good at debugging my shop but this one just slipped through as I ususally don't check the German version of my pages. Only when I change something and I want to make sure everything looks nice... and then it's something that small that causes this mixup.

 

abra

The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...