Ben224 Posted February 25, 2014 Share Posted February 25, 2014 Hello fellow cubecarters, Working with crosshatch 5.2.8. I really need to modify the standard 'select currency' menu to display flag graphics. For example please consider the following menu: (FlagGraphic) $ USD (FlagGraphic) $ CAD (FlagGraphic) £ GBP (FlagGraphic) € EUR There are a few old useful posts out there relating to the subject but I cant quite get it to work. Would appreciate a fresh, up to date approach if anyone can offer one? Many thanks in advance. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 25, 2014 Share Posted February 25, 2014 Here is something for the language selector, box.language.php: Was: <option value="{$language.code}" {$language.selected}>{$language.title}</option> Now: <option value="{$language.code}" {$language.selected} style='background-image:url({$STORE_URL}/language/flags/{$language.code}.png); background-repeat:no-repeat; padding-left:30px;'>{$language.title}</option> The problem with currencies is that CubeCart does not have flag filenames that include the ISO of the country, such USA.png, CAD.png, JPY.png, ZAR.png. You would need to copy the respective country flag image file to a new filename of the format ISO.png. Then you can apply the same technique as above. For {$language.code}, it would be {$currency.code}. Also, this might mess up your layout. So watch for that. Quote Link to comment Share on other sites More sharing options...
Ben224 Posted February 25, 2014 Author Share Posted February 25, 2014 Fabulous that works fine. Just one issue, the set currency does not show it's FlagGraphic. In other words: (FlagGraphic) $ USD - Flag not shown (FlagGraphic) $ CAD - Flag shown (FlagGraphic) £ GBP - Flag shown (FlagGraphic) € EUR - Flag shown Here is the modified block of code: <div class="select"> <select name="set_currency" class="auto_submit"> {foreach from=$CURRENCIES item=currency} <option value="{$currency.code}" {$currency.selected} style='background-image:url({$STORE_URL}/language/flags/{$currency.code}.png); background-repeat:no-repeat; padding-left:30px;' title="{$currency.name}">{$currency.symbol_left} {$currency.code} {$currency.symbol_right}</option> {/foreach} </select> Many thanks Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 25, 2014 Share Posted February 25, 2014 I forgot to mention that. I did see that. And some have reported that this works only for Firefox. Quote Link to comment Share on other sites More sharing options...
Ben224 Posted February 25, 2014 Author Share Posted February 25, 2014 It's a vast improvement! Would be perfect to have a flag represent the set currency but I can live without it for now. Thanks again. Quote Link to comment Share on other sites More sharing options...
bsmither Posted February 25, 2014 Share Posted February 25, 2014 I'll look for a jQuery plugin. Quote 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.