Jump to content

Client Area: Display Balance


wulfric

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.

 

{$totalbalance}

{$LANG.availcreditbaldesc}

{availcreditbaldesc}

{$availcreditbal}

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

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

etc..etc..

 

 

---

 

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}.

 

:twisted:

 

- - - 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>
</div>
{/if}

 

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

 

https://forum.whmcs.com/showthread.php?106891-Display-Credit-Balance-In-Six-Template

 

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

 

https://forum.whmcs.com/showthread.php?124790-Adding-a-quot-Credit-Balance-quot-panel-to-the-client-area-home-page&p=500630#post500630

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