Exactly. I already grabbed the array of client products using localAPI command GetClientsProducts but I was not able to return that array to smarty adminareaviewticketpage hook. Now, I have changed the hook to AdminAreaPage and achieved the array in template.
Thanks everyone for the suggestions.
yes, the custom field array is empty and so the message "No Custom Fields Setup for this Department" is displayed in the customfields tab. I don't have any custom field setup under the support department so its normal to have the $customfields array empty. But I have custom fields in the client services which I want to show on ticket page.
Basically, I want to display the custom fields of related service on the ticket view page. I checked the $relatedservices array in which custom fields are not included. Any suggestion on this?
I have a create a hook on event AdminAreaViewTicketPage to grab the customfield values of all services belongs to that client. I have the array with all the values but if I return it from function, just the word "Array" is displayed in view ticket page instead of a variable in the template. I have followed the below link and also the sample code on it behaves same.
https://developers.whmcs.com/themes/php/
thanks.