Jump to content

Client Area: Display Balance


Recommended Posts

Latest WHMCS using stock six template.


When I add {debug} to the top of clientareahome.tpl a new popout displays TONS of great things... I just want to recycle some of these smarty objects. For example, I wish to display client balance that someone would see in the notification area.. more or less..


The $LANG smarty objects seem to work, mostly. The other ones that display %s do not. I just don't understand.






availcreditbaldesc => "You have a credit balance of %s and this will be automatically applied to any..."

youhaveoverdueinvoices => "You have %s Overdue Invoice(s)






Here is a snippet of some example code, that I snagged from the debug popup window.


clientAlerts => Array (5)
 creditCardExpiring => "Your credit card :creditCardType-:creditCardLastFourDigits expires within :da..."
 domainsExpiringSoon => "You have :numberOfDomains domain(s) expiring within the next :days days."
 invoicesUnpaid => "You have :numberOfInvoices unpaid invoice(s). Pay them early for peace of mind."
 invoicesOverdue => "You have :numberOfInvoices overdue invoice(s) with a total balance due of :ba..."
 creditBalance => "You have a credit balance of :creditBalance."


- - - Updated - - -


Do I really need a hook, to display an already existing smarty object that is being loaded? Just seems redundant and inefficient. If the data is already being display...I should just be able to recycle the same {fancy.tag}.




- - - Updated - - -


I did a global search for the one tag, and found something helpful in five template.


{if $clientsstats.incredit}
<div class="alert alert-success">
   <p><strong>{$LANG.availcreditbal}:</strong> {$LANG.availcreditbaldesc|sprintf2:$clientsstats.creditbalance}</p>


I mean, it delivers results.. that's always good! A step into the right direction. So basically, I'm using {$clientsstats.creditbalance} to get the results I desire.




OOOOO I think it just hit me... the period symbol extends the smarty object! That's actually brilliant... :evil:

Edited by wulfric
more clarity, less words
Link to comment
Share on other sites

just for completeness, and in case you are unaware of the other options, sentq posted a sidebar hook to show the credit balance in the client area...




and if you wanted to show it as a homepage panel...



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.

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