Alec Posted February 1, 2011 Share Posted February 1, 2011 Hello All. I am looking for a solution to have pre-filled content within custom products/services fields. I specifically want to use custom fields and not configurable options as I would like the users to be able to edit the information and have that sent to the database in the normal manner as if they had entered all the data themselves... Looking through WHMCS's database I see that the custom fields are somewhat predictably kept in the 'tblcustomfields' table... But I see no column that directly influences what is within the custom field that is served to the user in the order form. Perhaps its possible to create a new column then input the data directly into the database... but I am not sure how I could link that column to the custom field. Any ideas on how to make this happen? Thanks. 0 Quote Link to comment Share on other sites More sharing options...
konradwalsh Posted February 2, 2011 Share Posted February 2, 2011 I too would like to figure this out 0 Quote Link to comment Share on other sites More sharing options...
msimonis Posted April 12, 2013 Share Posted April 12, 2013 Hi, you can do this by a hook. I choose the hook AcceptOrder. In this hook you get the orderid and can query the order via the internal api with the getorders-function. Within this Array you get the serviceid in ARRAY['orders']['order'][0]['lineitems']['lineitem'][0]['relid']. With this serviceid you can finally update the product of the customer with the internal api-function: updateclientproduct This is the way I found out, but I am not really sure if there isn't an easier way to do so. Maybe annother hook. I generate API-Keys via this. This is why i choosed the hook AcceptOrder. Regards, Matthias 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.