wulfric Posted March 25, 2017 Share Posted March 25, 2017 (edited) 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}. - - - 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... Edited March 25, 2017 by wulfric more clarity, less words 0 Quote Link to comment Share on other sites More sharing options...
AffordableDomainsCanada Posted March 26, 2017 Share Posted March 26, 2017 Using the smarty objects your going to be modifying the template and upone a WHMCS update your template may get overwritten, Using a hook you will not run into this problem.. 0 Quote Link to comment Share on other sites More sharing options...
wulfric Posted March 26, 2017 Author Share Posted March 26, 2017 TYVM for the added clarification. Using the smarty objects your going to be modifying the template and upone a WHMCS update your template may get overwritten, Using a hook you will not run into this problem.. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 26, 2017 Share Posted March 26, 2017 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 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.