veleno Posted February 6, 2016 Share Posted February 6, 2016 I'm customizing the client area menu and I've got two questions. i'm working into the hook "ClientAreaNavbars" 1. How can I use the language system to translate the menu label? 2. How can I get the prouduct goups info? Basically, name and cart URL. Any Idea? I've also opened a ticket, I'll post the answer here if I get one. Thank You -- Oto Tortorella TTservers.it 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 6, 2016 Share Posted February 6, 2016 1. use this function lang::trans('translationVariableName') 2. this information can be retrieved from Database, example: $select_group = full_query("select * from tblproductgroups where id = 1"); $groupinfo = mysql_fetch_assoc($select_group); echo $groupinfo['name']; 0 Quote Link to comment Share on other sites More sharing options...
veleno Posted February 8, 2016 Author Share Posted February 8, 2016 Thank you for the answer, sentq. I've got the support answer too. Here it is: 1. To achieve this, you'd format the label line like this: 'label' => Lang::trans('registerdomain'), Relevant documentation: http://docs.whmcs.com/Client_Area_Navigation_Menus_Cheatsheet#Adding_an_Additional_Child_Menu_Item 2. The product categories are not available as variables on every page within WHMCS. To view all available template variables you will just need to enter {debug} into any template file and then load it in your browser. Once loaded you will get a popup showing what template variables are available on that particular page. Not all variables are available on every page, and if the variable you wish to use isn't there, then you would need to obtain this yourself. http://docs.whmcs.com/Hooks:ClientAreaPage can be used to create your own smarty variables to use on the client area pages. More information: http://docs.whmcs.com/Templates_and_Custom_PHP_Logic ---- I believe that the right way to get the the prouduct groups info, working into the hook "ClientAreaNavbars", is to query the DB, as pointed by sentq. Isn't it? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 8, 2016 Share Posted February 8, 2016 I believe that the right way to get the the product groups info, working into the hook "ClientAreaNavbars", is to query the DB, as pointed by sentq. Isn't it? it's one way - if you just wanted to use the information normally on a template page, you could use a ClientAreaPage hook as provided by sentq last year... http://forum.whmcs.com/showthread.php?107122-assign-array-to-variable&p=439999#post439999 but using it in a NavBar? I suppose the query would be the same, it would just need a change to the output method (and hook used)... another option for Navbars would be to use the Class method. are you trying to make a menu dropdown with each child linked to a different product group? 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.