Jump to content

Recommended Posts

Running latest WHMCS - 5.3.8 - and I have a custom module I have written that is performing validation on custom field input when a user updates their shopping cart using the hook:

 

ShoppingCartValidateProductUpdate

 

If a user goes through the order process straight through, add product to cart, enter field data, click on the Checkout button from the Configure Product page, then validation takes place as expected and if not valid it does not proceed.

 

A problem arises however if a user first goes through the process and everything checks out, and then clicks on "Edit Configuration" under the product from the Review & Checkout page. They are then taken back to the Configure Product page, where they enter different data. If that data doesn't check out after they click Checkout and they decide to instead click on the back button in their browser, the invalid data that did not pass validation is now setup in their product configuration and will cause errors.

 

Am I supposed to also provide a way to 'undo' an invalid entry if they are editing the configuration? I would think a hook called 'ShoppingCartValidateProductUpdate' would validate before updating the database, and not update the database and then figure out if it should have.

 

Am I mistaken in this? Please let me know. Thanks.

Edited by gohigher
stupid smiley for 8)
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.

×
×
  • 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