Jump to content

Adding product/service name and expiration date to clientareahome?


Recommended Posts

In the clientareahome.tpl I want to include an array with a list of these items:

 

a) Each product/service name

b) Each product/service expiration date

c) The user's registered email address.

 

I found I could use

{$client.email|htmlentities}

to show the user's email address. But what should I use to show the name and expiration dates of the products?

 

Thank you

Link to comment
Share on other sites

a & b won't be available to the template as arrays as they aren't passed to it by WHMCS... so using Smarty isn't really an option.

 

therefore, you're practically left with three options...

 

1. as you mention clientareahome.tpl, I assume that you're thinking of using them in a homepage panel, e.g similar to the existing "Your Active Products/Services" panel?

 

if so, then you should be able to use the Class documentation within an action hook to create the panel.

 

http://docs.whmcs.com/Working_With_Client_Area_Home_Page_Panels

 

it would probably be "easier" to create a new panel rather than try to modify the existing above panel... you could modify it, but I suspect the resulting code would be longer than just starting from scratch. :roll:

 

btw - the code within WHMCS that creates the existing homepagepanels is encrypted - for reasons that are beyond me!

 

2. if this is not to be used in a panel, then you could use a standard action hook, perhaps ClientAreaPageHome to query the database (e.g, using Capsule) and pass the array(s) back to the page.

 

3. I suppose you could use a data feed to display the information on the homepage - but in order to do that, you'd need to query the database, and if you know the specific query to use, then that would likely be the same query needed by the hook in 2 ! :)

 

so there are various methods, the best one depends on what you want to do with the arrays and where/how you want to display them.

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.

×
×
  • 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