Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Drop down currency with flag images


Recommended Posts

Hello, i'm trying to put a flag beside each currency.


i have added the upload flag in the admin / currencies (working fine, now i have the flags stored)


but how can i display the flag in the drop down options?


i tried to adjust the includes/functions/html_output.php, but didn't figure it out.


any hints?

Link to comment
Share on other sites

Some people have tried using the flag image as a background image for each <option> entry, with an id= or inline style= on each. However, that may not work on a large enough selection of browsers, nor might it display the image (just the text) when the selection drop-down closes. Others have suggested faking a selection list using Javascript. Plenty of good reading if you Google html selection image.

Link to comment
Share on other sites

well, you are right @@MrPhil, it wont display the image of the selected option.


maybe i should turn the function tep_draw_pull_down_menu to a listing instead of <select>


do you think its a good idea and worth trying ??

Link to comment
Share on other sites

It should be possible to do something that resembles a selection list, but with graphics and text for each entry, using Javascript or a JS library. In the "closed" position, it would show the current/default selection, and wait for a mouse click to display a list below it. For each entry, use onmouseover() and onmouseout() JS functions to highlight by changing the background and border, and onclick() to select and mark the selection. Maybe display: none for the list in the "closed" position and maybe display: block for "open". You might have to give a z-index: 10 on the list to make sure it floats above everything else. Something like that ought to work, but it could be a lot of extra work to get a scrolled list. Flyouts (multilevel selection lists) could also be done. I'll bet if you google javascript drop down menu or similar terms, you'll find lots of code already written. Don't forget to include a way to retrieve the current selection to return in the <form> data (perhaps a hidden field set to the current selection value).


Of course, you would probably want to copy tep_draw_pull_down_menu() to tep_draw_pulldown2_menu() and start from there, unless you want to ensure that all your pull-down menus look and work exactly the same way.

Link to comment
Share on other sites

Posted · Hidden by Harald Ponce de Leon, June 6, 2013 - No reason given
Hidden by Harald Ponce de Leon, June 6, 2013 - No reason given



included in Twig Dynamic Template System.


based on https://github.com/foxp2/BootstrapFormHelpers-for-osCommerce-2.4/commit/0b1a4241d4e42c4b05401f1cecd5c13cc23eb9a0


an extension developped & adapted for osCommerce 2.4



Link to comment


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

  • Create New...