biaprot Posted September 11, 2015 Share Posted September 11, 2015 Hello ! I am having a problem on Product Groups show on homepage.tpl . I use this code but missing tblproductgroups {php} $userid = $this->_tpl_vars['clientsdetails']['id']; $result = mysql_query("SELECT * FROM tblhosting,tblproducts WHERE userid =$userid AND tblhosting.packageid= tblproducts.id"); $services = array(); while ($data = mysql_fetch_array($result)) { array_push($services, $data); } $this->_tpl_vars['services'] = $services; {/php} From this Topic : http://forum.whmcs.com/showthread.php?48409-Customise-clientarea-tpl-to-display-Active-Products-Services Like this : Anyone can help me , thanks 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 11, 2015 Share Posted September 11, 2015 there are at least three problems with this... 1. using code posted from 2-3 years ago, isn't ideal! 2. using {php} tags in the template will, at some point, be disabled. 3. $this->_tpl_vars has been changed. for 3, read the documentation below... http://docs.whmcs.com/Version_6_Template_Migration_Guide#.7Bphp.7D_Block_Syntax for the SQL query, you could try... SELECT * FROM tblhosting,tblproducts,tblproductgroups WHERE userid = $userid AND tblhosting.packageid = tblproducts.id and tblproductgroups.id = tblproducts.gid it's not very efficient, but it will give you the product group name. 0 Quote Link to comment Share on other sites More sharing options...
biaprot Posted September 12, 2015 Author Share Posted September 12, 2015 Hello ! i try but not working 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 12, 2015 Share Posted September 12, 2015 Hello ! i try but not working i'm not surprised. if I were you, I wouldn't waste any time trying to fix this - even if you could get it to work now, it will fail as soon as WHMCS disable {php} tags. there would be two better ways to do this - either use an action hook to create the required variables and pass them to the modified homepage template, or use a Data Feed to embed the output you want. if you're new to either solution, the data feed option would probably be the simplest - the core part of both is the SQL query, and you already have that. take a look at some of the existing data feeds in the 'feeds' directory, and you should see how they work. 0 Quote Link to comment Share on other sites More sharing options...
biaprot Posted September 12, 2015 Author Share Posted September 12, 2015 Thank you 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.