Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Image to language


Recommended Posts

Hello, i am new to oscommerce and also to php. I (will)have site in two(or three) languages(en,ru), so i wanted site slogan image change in to corresponding language in wich visitor is viewing my shop.

Em.. well, ok, the code im thinking to use should look like something this:


if (LANGUAGE=='ru') {
 echo ('<img src="images/hello-ru.jpg">');

else {
 echo ('<img src="images/hello-en.jpg">');



and im not sure the second string is correct.

what it must look like?


Link to comment
Share on other sites

This sort of code needs to go into the header (before the html code begins):

if ($languages_id == "1") { $image = "image1.gif"; }
elseif ($languages_id == "4") { $image = "image2.gif"; }
else { $image = "image1.gif"; }


Then in that part of the header where the logo href normally appears you would put this:

<a href="index.php"><img src="images/<? echo "$image"; ?> " border=0></a>


This code is for an English and Dutch website, so you'd need to look in your database to see which numbers are used by the languages you wish to use on your site. Don't use 'ru' or 'en' - use the language id numbers.



Link to comment
Share on other sites


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

  • Create New...