jrianto Posted October 28, 2008 Share Posted October 28, 2008 I am trying to create some custom application within WHMCS. I am having some problem trying to figure out to display other template's client variables within my custom pages. For example, I see on clientareahome.tpl file, there is a variable {$stats.creditbalance} I tried using this variable in my own custom file agent.tpl, but its value does not show up. That is just one example, I am trying to create an application within WHMCS which needs to access various variables which I already see on your other template files. For example, I would also need to display some orders variables, transaction variables, invoices variables, etc, etc. How do I make all these variables accessible from my custom template file? So I can refer to other templates on using this variables and have the values show up. 0 Quote Link to comment Share on other sites More sharing options...
nielsenj Posted October 28, 2008 Share Posted October 28, 2008 Put the tag {debug} in the specific templates you want to add tags to and browse to it. A window will pop up giving you a list of all usable tags for that specific template. Regards, J 0 Quote Link to comment Share on other sites More sharing options...
jrianto Posted October 28, 2008 Author Share Posted October 28, 2008 Thanks J. I am aware of the {debug} directive, but what I am trying to do is to actually access variables available on OTHER template files. For example, I am trying to display the value of {$stats.creditbalance} which is available on the clientareahome.tpl template. How do I display that value on my own template file? 0 Quote Link to comment Share on other sites More sharing options...
nielsenj Posted October 28, 2008 Share Posted October 28, 2008 The codes you see with the {debug} tag are the only ones that WHMCS populates for the specific template. If you want to use any others then you have to recreate what WHMCS does and get the information yourself through a DB query using php tags or an external file. The easiest way is to probably execute the query via WHMCS's own db functions within the template using {php} codes. 0 Quote Link to comment Share on other sites More sharing options...
jrianto Posted October 29, 2008 Author Share Posted October 29, 2008 Yes I think that is the only way to go. Thanks 0 Quote Link to comment Share on other sites More sharing options...
jrianto Posted October 29, 2008 Author Share Posted October 29, 2008 How do I access the smarty array variables within the {php} section? For example: {php} $custlanguage = $this->get_template_vars('language'); print "$custlanguage"; {/php} That will display "English". But what if the smarty variable is an array like {$clientsdetails}. I tried using: $custfirstname = $this->get_template_vars('clientsdetails->firstname'); $custfirstname = $this->get_template_vars('clientsdetails[0]'); Both does not work. Any help would be appreciated. Thanks 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted October 30, 2008 Share Posted October 30, 2008 $custfirstname = $this->_tpl_vars['clientsdetails']['firstname']; Does that help out a little 0 Quote Link to comment Share on other sites More sharing options...
cyberneticos Posted June 9, 2009 Share Posted June 9, 2009 Helped me !! Thanks ! 0 Quote Link to comment Share on other sites More sharing options...
Unknown Posted June 18, 2009 Share Posted June 18, 2009 If I wanted to be able to use the $domain.idprotectionprice variable in viewcart template, what would I use? I tried $this->_tpl_vars['configuredomains']['domain']['idprotectionprice'] but that didn't work. Thanks for any help 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.