Jump to content

Ajax order form and client custom fields


oderland-david

Recommended Posts

Hi!

 

Just started modifying the ajax order form to fit our needs and am getting stumped by trying to insert data into the customfields for a client.

I've created the custom field in whmcs admin and it's got ID: 8 in tblcustomfields and I've modified the addClient function call in index.php of the ajax order form:

 

$userid = addClient($firstname,$lastname,$companyname,$email,$address1,$address2,$city,$state,$postcode,$country,$phonenumber,$password1,'','','','','','','','',base64_encode(serialize(array("8"=>$orgno))));

 

I'm not quite sure if I'm using the right attributes for addClient since those functions are encrypted (is there anywhere one could see some phpdoc for classes and methods?) - but I've followed the "order" of the addclient API call.

 

Should I just remove that line and go with an API call right off? ;)

Edited by oderland-david
Link to comment
Share on other sites

Solved it with a workaround.

Created an api class and used it inside index.php to call updateclient and added the customfields values right after the function call mentioned below with the returned userid.

 

Hi!

 

Just started modifying the ajax order form to fit our needs and am getting stumped by trying to insert data into the customfields for a client.

I've created the custom field in whmcs admin and it's got ID: 8 in tblcustomfields and I've modified the addClient function call in index.php of the ajax order form:

 

$userid = addClient($firstname,$lastname,$companyname,$email,$address1,$address2,$city,$state,$postcode,$country,$phonenumber,$password1,'','','','','','','','',base64_encode(serialize(array("8"=>$orgno))));

 

I'm not quite sure if I'm using the right attributes for addClient since those functions are encrypted (is there anywhere one could see some phpdoc for classes and methods?) - but I've followed the "order" of the addclient API call.

 

Should I just remove that line and go with an API call right off? ;)

Link to comment
Share on other sites

  • 1 month later...

Hi,

 

With some general php coding knowledge you should be able to modify the index.php file to include steps to modify the client after it has been added.

 

Check the wiki:

 

http://wiki.whmcs.com/API:Example_Usage

http://wiki.whmcs.com/API:Update_Client

 

Otherwise you'll just have to wait until they release a new version of the order form or find someone who can help you with it.

 

Hi, how i can use the custom fields on ajax cart ???

 

I don't understand how i can display and insert to the client after checkuot.

 

Regards.

Link to comment
Share on other sites

Solved it with a workaround.

Created an api class and used it inside index.php to call updateclient and added the customfields values right after the function call mentioned below with the returned userid.

 

Can you post the solution how you solved it , thanks

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