Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

need your very litle time :-)


Pelvis

Recommended Posts

I have a multilingual Store with 3 Languages (English German and Greek) if a customer change the language of the store then it should displayed another image depends on the language. See the code that I have manage but the problem is that all three images are displayed but I want only the image from the Language that is selected on shops dropdown to be displayed not all 3 only one banner.

<?php	
  /* BOF multilanguage images */
	if ($language='en') {echo '<img style="margin-top:4px;" src="images/english-banner.png" height="40">';
    } 
	if ($language='de') {echo '<img style="margin-top:4px;" src="images/german-banner.png" height="40">';
	}
    if ($language='gr') {echo '<img style="margin-top:4px;" src="images/greek-banner.png" height="40">';
    } 
  // EOF multilanguage images
?>

 

Multilanguage-image.jpg

Link to comment
Share on other sites

Hello old man? You are one of the dinosaurs here on OSC forum ...you are not tired yet? Happy to see people that have passion on OSC 🙂

This doesn't work Jack if I do apply the changes nothing was displayed like the attached picture.

<?php	
  /* BOF multilanguage images */
	if ($language=='en') {echo '<img style="margin-top:4px;" src="images/english-banner.png" height="40">';
    } 
	if ($language=='de') {echo '<img style="margin-top:4px;" src="images/german-banner.png" height="40">';
	}
    if ($language=='gr') {echo '<img style="margin-top:4px;" src="images/greek-banner.png" height="40">';
    } 
  // EOF multilanguage images
?>

 

Multilanguage-image-empty.jpg

Edited by Pelvis
Link to comment
Share on other sites

1 hour ago, Pelvis said:

Hello old man? You are one of the dinosaurs here on OSC forum ...you are not tired yet? Happy to see people that have passion on OSC

It has been a long time since you posted, as I recall. Yeah, there's a few of us left though I'm moving somewhat slower nowadays. :)

 

Are you sure $language is set where that code is at?

Without seeing the code in context I can't say what the problem is. But there are many addons that displays images based on the language. Here is one of mine (or see the header of my site for an example). You can search the apps section for flags and it will show many that may be close to what you want.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hello,

looking the code across to develop new modules, OSCV4 is a mix between 2 different codes, one based on the V2.3, another based on Yii.
For example :
the query can be written in 2 different ways.
There are also many duplications about the code between Yii and v2.3
Advantage, the transition between v2.3 and Yii will more easy for the community but I recommend to use the Yii function if you decide to code
Inconvenient: We have 2 different frameworks inside at this moment. I hope in the future we will go on just one and the people will continue to use the old approach, no very good.

 

 

 


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...