Jump to content

hook error handling - not documented


thoraxe

Recommended Posts

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?

Link to comment
Share on other sites

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.

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