Jump to content

How can I access customfield in hook?


Recommended Posts

I am creating a ShoppingCartValidateProductUpdate hook.

 

In order process has a two customfields (login and password).

 

One of the variables of this hook, is the array "customfield".

 

How can I access the specific customfield? I got it entering the ID of customfields that I found accessing the WHMCS database. Like this: $vars["customfield"]["1"].

 

There is an easier way to access the customfield? Like for example entering the name of customfield?

 

Like this: $vars["customfield"]["Login"]

Link to comment
Share on other sites

as described in the documentation, you can call each customfield with their IDs:

$vars['customfields'][5];

 

There is an easier way to access the customfield? Like for example entering the name of customfield?

 

Like this: $vars["customfield"]["Login"]

 

you can query Database to get this information, but you will need product/service ID for that purpose which is not available in this ActionHook point.

http://docs.whmcs.com/Hooks:ShoppingCartValidateProductUpdate

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