Jump to content

How to intercept (hook) product configuration in Shopping Cart


cloudFire alex

Recommended Posts

Hello fellow WHMCS friends,

I am looking for a way to validate custom fields in the "product configuration" options when checking out a product in the shopping cart.

The use case looked pretty simple but became unsolvable: I want my customers to specify a hostname for virtual servers with some conditions.

First, just enter a a regex validated hostname like "host.location.domain.tld" (I know, I can specify and validate regex as builtin option in WHMCS, so thats not the point).
But then I need to intercept before it comes to the cart checkout page.

1. If the FQDN is already used within our zone (*.cfire.cloud) it must throw an error and the customer must choose a different hostname.
2. If the FQDN is _not_ within our zone (*.cfire.cloud), the hostname should be accepted as long as the regex validates it.
3. The this way selected hostname should become the WHMCS native "domain" for the product that is shown on Clients Page together with the product.

How to code this myself is not the problem, but _where_ can I intercept this order process to execute my checks and array settings? There is no hook for this position.  "ShoppingCartValidateCheckout" is too late...
Maybe WHMCS would setup a hook, if I ask them...? Any ideas or experiences?

Thank you and best regs,
Alex

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