Chris Poulter Posted November 25, 2009 Share Posted November 25, 2009 Hi, Another quick question - any responses appreciated! I would like to add a table to the client area home page that lists the clients products/services. However, this requires the $service variable which is not passed to that page by default. Is there any way of adding this variable to the page? All the best, Chris 0 Quote Link to comment Share on other sites More sharing options...
nelutu Posted September 19, 2011 Share Posted September 19, 2011 I'd also like to know how to do that, I am trying to list the products / services on the client area home page. Any pointers anyone? Thank you 0 Quote Link to comment Share on other sites More sharing options...
sdemidko Posted September 19, 2011 Share Posted September 19, 2011 Hi, Another quick question - any responses appreciated! I would like to add a table to the client area home page that lists the clients products/services. However, this requires the $service variable which is not passed to that page by default. Is there any way of adding this variable to the page? All the best, Chris since whmcs code encrypted I can assume they assigning variables specifically for every page so putting {foreach key=num item=service from=$services} ... {/foreach} wont solve the problem instead you need to get the data and assign it for specific page/template changing the code of clientarea.php is impossible so you need to change clientareahome.tpl lets say something like this: {php} //here you are searching for all services, that belongs to logged client $result = select_query("tblhosting", "id, domain, regdate, packageid", array("userid" => $_SESSION['uid'])); while ($row = mysql_fetch_array($result)) { //you need to find corresponding product for every row, cause it doesnt have product names } //then you have to assign result to a smarty variable $this->_tpl_vars['user_services'] = $your_result; {/php} below in template you can use that variable {$user_services} thats a basic code mockup, not finished, I didnt test anything, also you may try to use internal API instead, but it returns XML, so it would be harder to parse it regards. 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.