I want to streamline the process of ordering a new domain from my website to achieve the following:
1. Use POST variables so I can easily send the request from my website to WHMCS
2. in the WHMCS cart page, check if a domain is available
3. *IF* the domain is *NOT* available, remain at the result cart.php page
3b. *IF* the domain *IS* available, automatically add it to the cart with a 1 year registration plan and then redirect the user to /cart.php?a=view screen
So far, I have found a way to have the 1 year automatically picked and the user directed to the domain configuration page, but this bypasses the domain checker which is not acceptable as it would falsely imply a user can register a domain that is unavailable. I can alternately use POST variable to send the desired domain to the checker, but the user then has to manually click add to cart, then checkout, then selection options, etc, which is what I'm trying to avoid.
Is there any way to achieve the steps I outlined above? I tried adding some javascript to /scripts.js in the domain checker function, but it doesn't appear to fire for some reason. I'm new to WHMCS so I must be doing something wrong with that attempt.
Any help is appreciated!