I want to add some custom validation to the checkout button. I already am using this code to do some extra things on the button click by using this:
FC.checkout.overload("validateAndSubmit", "removeNonSelectedChoice", null);
but I never had to actually cancel the submit if a certain condition didn't exist. I know i can use the fc_required class but in this case i have some fairly complex logic (if one field is set to this and another field is set to this, then don't submit and alert to the user that your settings are not valid.
How can I add some custom validation when the user clicks submit on the checkout screen and allow me to return a certain value that will alert the user and cancel the form from submitting?
I see a few posts around validation before adding to a cart (like here
) but I don't see the equivalent around checkout submit.
Any example code would be greatly appreciated !!