Pelvis Posted March 19, 2022 Share Posted March 19, 2022 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 ?> Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted March 19, 2022 Share Posted March 19, 2022 32 minutes ago, Pelvis said: if ($language='en') When comparing you need to use ==, not =. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Pelvis Posted March 19, 2022 Author Share Posted March 19, 2022 (edited) 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 ?> Edited March 19, 2022 by Pelvis Quote Link to comment Share on other sites More sharing options...
Pelvis Posted March 19, 2022 Author Share Posted March 19, 2022 Need this Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted March 19, 2022 Share Posted March 19, 2022 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. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Pelvis Posted March 19, 2022 Author Share Posted March 19, 2022 I have find it! ...This is what i want, thanks for your nice time here Jack 🙂 Quote Link to comment Share on other sites More sharing options...
Pelvis Posted March 19, 2022 Author Share Posted March 19, 2022 What's your opinion about new OSC 4? based on a MVC frameworks Yii , more complicated its a system on another system :-) Quote Link to comment Share on other sites More sharing options...
♥Gyakutsuki Posted March 20, 2022 Share Posted March 20, 2022 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. Quote 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 More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.