wulfric Posted February 28, 2017 Share Posted February 28, 2017 Latest WHMCS using stock six theme -- How do I show the balance across the entire site to logged in user? Only when a logged in visitor is on the affiliate page, does the balance show. My primary nav has a menu item in the header.tpl file and it looks like this: <a href="{$WEB_ROOT}/affiliates">Affiliates{if $loggedin} {$balance}{/if}</a> Thanks in advance for your attention, p.s. - , intro beat is wicked 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 28, 2017 Share Posted February 28, 2017 you want it in the sidebar, the navbar or elsewhere ? wherever, I think you're looking at writing an action hook. 0 Quote Link to comment Share on other sites More sharing options...
wulfric Posted March 6, 2017 Author Share Posted March 6, 2017 Thanks for the quick reply. How do I extend the already existent action hook onto other pages? You are requesting that I write another action hook for the existing action hook on affiliates page? yea? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 6, 2017 Share Posted March 6, 2017 How do I extend the already existent action hook onto other pages? you don't - it will be created in an encrypted file to which you won't have access. You are requesting that I write another action hook for the existing action hook on affiliates page? yea? yes. WHMCS just makes the affiliate balance available on the affiliates page - if you want to extend where it's used, then you need to create a new hook... you can't extend an existing hook you don't have access to! anyway, it's not difficult and you wouldn't need to query the database if you just want to make the balance Smarty variable available throughout the client area. <?php function hook_affiliate_balance($vars) { $client = Menu::context('client'); $balance = $client->affiliate->balance; $currencyID = $client->currencyId; return array("balance" => formatCurrency($balance, $currencyID)); } add_hook("ClientAreaPage", 1, "hook_affiliate_balance"); ?> 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.