Jump to content

Pre-Filled Custom Fields... How to?


Alec

Recommended Posts

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.

Link to comment
Share on other sites

  • 2 years later...

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

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