Jump to content

Customizing the client area menu


veleno

Recommended Posts

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

Link to comment
Share on other sites

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'];

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated