Jump to content

How to access to a custom field from client template?


quicklyweb

Recommended Posts

Okay i have to show server id on client section. I define the serverid customfield 8 in admin section. But i need to show the customfield 8 value in client area productinfo page. But i can't work out how to access to this variable from client section.

Link to comment
Share on other sites

Okay i have to show server id on client section. I define the serverid customfield 8 in admin section. But i need to show the customfield 8 value in client area productinfo page. But i can't work out how to access to this variable from client section.

 

Yeah worked it out at the end lol ;-)

Link to comment
Share on other sites

If you have a solution, you really should post it so the next person looking for this information can find it easily. Frustrating to find post after post of "I found it". ;)

My apologees.

 

Solution is $param[$customfields]['CustomFieldName']

 

CustomFieldName is the name you given to the custom field in admin section when you were creating the custom field.

Link to comment
Share on other sites

  • 1 month later...
My apologees.

 

Solution is $param[$customfields]['CustomFieldName']

 

CustomFieldName is the name you given to the custom field in admin section when you were creating the custom field.

 

I used: {$param[$customfields]['mobile']} in clientssummary.tpl and didn't work. Blank page...

 

Any idea? I need to call a custom field of type client (name: mobile) on my template...

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

The first thing you have to do is make sure that the info you want is available through the smarty object. To do that edit the template you want to use and put {debug} at the top or put at the top of header.tpl and it will come up for all pages. Then access this page as normal through the web browser. A window should popup showing all of the current values that are in the smarty object. If what you want is not there then you have to create a custom page or action hook (see wiki on how to do that - requires php knowledge).

As for client customfields they can be accessed with {$clientsdetails.customfields1} The number at the end should be its order on the clients profile page in the admin. Use the smarty debug console to make sure.

Link to comment
Share on other sites

  • 2 weeks later...

Sorry for the late follow-up but THANK YOU for your direction!

 

This helped me solve my issue. My (lack of) php knowledge led to a number of failed attempts due to syntax but there was a value already defined by whmcs that shows the server name on the template I needed:

 

{$server.name}

 

Thanks!

Link to comment
Share on other sites

  • 7 years later...

Hi, 
I Realy new in WHMCS I try to Create a Provisioning Module.

I have the same problem to get custom data from a client in the creation of new product/Service. for example, I want to get IP address or Server user and pass so I need custom fields but I really don't know where should I define them for clients and product/service creation step.

 

Thanks. 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • 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