How can we improve WHMCS?

Share, discuss and vote for what you would like to see added to WHMCS

Hook into Order Forms to Process Custom Fields Data prior to Checkout

  • Marcel Stiller shared this idea 2 years ago
  • Order Forms
  • 1 Comment


To customize some order processes I'd like to propose a new hook.

Order->Product Configuration

can have a lot of "Configurable Options" or "Customized Fields" which for certain products can be a lot more challenging to verify or validate than a regular expression.

Examples:
- Selection combinations that are invalid (When using Dropdown "Type A" the custom field "Data" must remain blank, but when using "Type B" it must be an ip adress)
(Yes, this special example might be solvable by javascript, but it gets further)
- A custom field that should contain a hostname. This hostname must be checked for availability in a private namespace by an PHP API call
- Making changes to default settings in WHMCS arrays depending on what was entered on Product configuration space with data from external sources (also remoteAPI call)

Thereafter the hook may exit with a success (-> continue to checkout) or error(s) (remain on order configuration page and let the customer solve his error issues).

Having something like a run_hook('ShoppingCartConfProduct', $PRODUCT); would be a great help.

1 Comment

Login to post a comment.

The hook is called "ShoppingCartValidateProductUpdate". This works and the request should be closed. Thanks.