BAJI26 Posted July 26, 2015 Share Posted July 26, 2015 (edited) Is there anyway to get the Product Group Name to place on an external pages? Like how you can get the Product Name: <script language="javascript" src="feeds/productsinfo.php?pid=1&get=name"></script> Edited July 26, 2015 by BAJI26 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 26, 2015 Share Posted July 26, 2015 Is there anyway to get the Product Group Name to place on an external pages?Like how you can get the Product Name you may have answered your own question! you will need to create/modify a data feed to get the required value from the database. e.g, open up productsinfo.php and add the following *after* the if (is_numeric($pid)) { block of code... if (is_numeric($gid)) { $groupresult = select_query("tblproductgroups", "", array("id" => $gid)); $groupdata = mysql_fetch_array($groupresult); $groupname = $groupdata['name']; } if ($get=="groupname") widgetoutput($groupname); when you've done that, you should be able to call the Group Name in a similar way... <script language="javascript" src="feeds/productsinfo.php?pid=1&get=groupname"></script> as a general rule, you shouldn't edit existing data feeds as they might get overwritten during a WHMCS upgrade - but for testing it's fine! also, there are neater ways to do the query (i.e have 1 joined query instead of 2 separate ones), but the above will work. 0 Quote Link to comment Share on other sites More sharing options...
BAJI26 Posted July 26, 2015 Author Share Posted July 26, 2015 Thanks, I tried it but I get: Invalid get option. Valid options are "name", "description", "configoption", "orderurl" or "price" 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 27, 2015 Share Posted July 27, 2015 apologies for that, I missed out posting one line from the if (is_numeric($pid)) block of code - the first query needs to get the group ID from the database... in the data feed code, you'll see the following line... $pid = $data['id']; directly after that line, add the following.. $gid = $data['gid']; once you add the line, then the second query can get the correct group name... let me know if it doesn't work now! 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.