system32 Posted May 26, 2018 Share Posted May 26, 2018 I want a currency option from the header section of our theme. I tried some resources, but it didn't. For example, the following codes. The menu does not open. 1 Quote Link to comment Share on other sites More sharing options...
brian! Posted May 27, 2018 Share Posted May 27, 2018 On 26/05/2018 at 22:35, system32 said: I want a currency option from the header section of our theme. I tried some resources, but it didn't. For example, the following codes. did you follow that thread to the final post which linked to an updated thread that works with v7.2.2? having checked the code in the updated thread again, I can confirm that it still works with v7.5.1 (using the Six template)... On 26/05/2018 at 22:35, system32 said: The menu does not open. which implies that it's a JavaScript / jQuery issue... that's very likely if you followed the original thread as that code is out of date for current WHMCS v7.5 releases. so if you followed the updated thread, make the changes to header.tpl and the required changes to templates/six/js/scripts.min.js (usually by editing scripts.js and minifying it) then this currency header code will work with the "Six" template... if you're using a custom template (especially one not based on Six), then it may not necessarily work, or might require changes to different files in order to do so... your WHMCS client area seems to be down, so I was unable to determine what you are using. as a further update to this, you can add the currency header changes without the need to modify scripts.min.js - so this solution requires only a template code change within header.tpl to work, no other external js modifications. in v7.5.1, it would be... <!-- Currency --> {if !$loggedin && count($currencies) > 1} <li> <a href="#" class="choose-currency" data-toggle="popover" id="currencyChooser" data-container="body" data-placement="bottom" data-content='{foreach from=$currencies item=currchoice}<img src="{$BASE_PATH_IMG}/flags/{$currchoice.code|substr:0:2|strtolower}.png"> <a href="{$currentpagelinkback}currency={$currchoice.id}">{if $currency.id eq $currchoice.id}<u>{/if}{$currchoice.code}</u></a>{/foreach}'><i class="fa fa-usd"></i> <b class="caret"></b></a> </li> {/if} the updated method would also work in v6.2.2 too (though using slightly different code because of layout changes since that release)... {if !$loggedin && count($currencies) > 1} <div class="pull-right nav"> <a href="#" class="quick-nav" data-toggle="popover" id="currencyChooser" data-container="body" data-placement="bottom" data-content='{foreach from=$currencies item=currchoice}<img src="{$BASE_PATH_IMG}/flags/{$currchoice.code|substr:0:2|strtolower}.png"> <a href="{$currentpagelinkback}currency={$currchoice.id}">{if $currency.id eq $currchoice.id}<u>{/if}{$currchoice.code}</u></a> {/foreach}'><i class="fa fa-usd"></i> {$LANG.choosecurrency}<span class="caret"></span></a> </div> {/if} so i've no reason to assume that the updated code wouldn't work in any WHMCS release since v6.22 (probably even earlier versions of v6 too - but I don't have a dev to check that). also, because it's just relying on Bootstrap JS Popover, it will likely have a greater chance of working on custom templates too. v7.7.1 update - to take account of the Font Awesome changes, the code should be... <!-- Currency --> {if !$loggedin && count($currencies) > 1} <li> <a href="#" class="choose-currency" data-toggle="popover" id="currencyChooser" data-container="body" data-placement="bottom" data-content='{foreach from=$currencies item=currchoice}<img src="{$BASE_PATH_IMG}/flags/{$currchoice.code|substr:0:2|strtolower}.png"> <a href="{$currentpagelinkback}currency={$currchoice.id}">{if $currency.id eq $currchoice.id}<u>{/if}{$currchoice.code}</u></a>{/foreach}'><i class="far fa-dollar-sign"></i> <b class="caret"></b></a> </li> {/if} 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted June 12, 2020 Share Posted June 12, 2020 Nice idea ! How to get it work for 7.8 please? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 13, 2020 Share Posted June 13, 2020 15 hours ago, Kelby said: How to get it work for 7.8 please? the above would still work in any version of Six after v7.7... the main issue you might hit is if you are using currencies for which WHMCS doesn't include a native flag - if that occurs, then I would use a different flag directory for the images, get all flags icons from the same source site and use them instead - there's no point replacing existing flag image files as WHMCS would just overwrite them during an update. 0 Quote Link to comment Share on other sites More sharing options...
Kelby Posted June 15, 2020 Share Posted June 15, 2020 On 6/13/2020 at 1:14 PM, brian! said: the above would still work in any version of Six after v7.7... the main issue you might hit is if you are using currencies for which WHMCS doesn't include a native flag - if that occurs, then I would use a different flag directory for the images, get all flags icons from the same source site and use them instead - there's no point replacing existing flag image files as WHMCS would just overwrite them during an update. Nice work! Would you please give me this code? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 15, 2020 Share Posted June 15, 2020 37 minutes ago, Kelby said: Would you please give me this code? it's the same as posted above - except the output is in a 3 column div and is using a custom folder for the icons. {if !$loggedin && count($currencies) > 1} <li> <a href="#" class="choose-currency" data-toggle="popover" id="currencyChooser" data-container="body" data-placement="bottom" data-content='{foreach from=$currencies item=currchoice}<div class="col-md-4"><img src="{$BASE_PATH_IMG}/newflags/{$currchoice.code|substr:0:3|strtolower}.png"> <a href="{$currentpagelinkback}currency={$currchoice.id}">{if $currency.id eq $currchoice.id}<u>{/if}{$currchoice.code}</u></a></div>{/foreach}<br><br>'><i class="fal fa-sack-dollar"></i> <b class="caret"></b></a> </li> {/if} 0 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.