Jump to content

Help! How to validate other site data before config option change?


Recommended Posts

Hello everyone,


My requirement is that let's say I have one configuration option called "personal computer" which is text box.

User will fill 1, 2, 3, etc...

When they check out ("Click to Continue" button), I need to check one value from my another site by calling web service.

Eg. If they fill 3 and result from another site is less than 3, they cannot check out.


My problem is I don't know whether there is a hook that run before user can checkout.

I had tried following hooks but still can't find the solution.

1) ShoppingCartValidateProductUpdate,

2) ShoppingCartValidateCheckout

3) ShoppingCartValidateProductUpdate

4) ShoppingCartValidateCheckout

5) PreShoppingCartCheckout

6) PreCalculateCartTotals


Most of them are not working, or, I don't know when will they fire.


Please help me. Is this possible to achieve?

Or is there any work around to achieve this?


Thanks in advanced


Link to comment
Share on other sites

  • 6 years later...

Work on WHMCS 7

add_hook( 'ClientAreaPage', 1, function ( $params ) {
  if (
    $step == 2 &&
    ! empty( $params['filename'] ) &&
    ! empty( $params['type'] ) &&
    ! empty( $params['loggedin'] ) &&
    $params['filename'] == 'upgrade' &&
    $params['type'] == 'configoptions' &&
    $params['loggedin'] == true
  ) {
    ...do some here...

  return $params;
} );
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.

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.

  • 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