thoraxe Posted January 16, 2013 Share Posted January 16, 2013 At this time there is not a hook that runs on the configure product page. This means that, if I need to externally validate a configuration option, I probably need to do it during the actual check-out process. That being said, there is no documentation on how to actually handle a negative result for a hook. In fact, there's no documentation I see on how to handle a successful result, either. The sample code, hook_create_forum_account, doesn't document either. It seems to simply assume that all hooks execute successfully. 1) Does anyone know how to get information to the user during the various hook processes? 2) In the case of an error (for example, the hook PreShoppingCartCheckout), how would I get that error message to the user and re-direct them to the shopping cart (or, in my case, the configure product page) so that they can change their options? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS JamesX Posted January 16, 2013 Share Posted January 16, 2013 Depending what you're doing and where, $errormessage It's a fairly standard error variable within the client area. $errormessage .= ''; Add your error message. 0 Quote Link to comment Share on other sites More sharing options...
thoraxe Posted January 16, 2013 Author Share Posted January 16, 2013 Yeah, I just noticed that, but I'm not sure what to do with it or how it works. If my hook function places a string in $errormessage, does that automatically mean that the "process" is stopped? For example, if I add a hook to ShoppingCartValidateCheckout and put "foo" in $errormessage, does that mean that the checkout process automatically fails and stops BEFORE the checkout is attempted? Thanks for the hint so far! I am liking what I'm seeing, generally, just having issues figuring out the semantics. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.