Jump to content

show affiliate {$balance} outside of affiliates.tpl page


wulfric

Recommended Posts

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
Link to comment
Share on other sites

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! :idea:

 

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. :idea:

 

<?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");
?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated