0

I'm using Commerce Postal Code Filter to blacklist some delivery postcodes.

When a delivery matches the blacklist validation fails and form_set_error is applied.

The problem here is that this means the Customer Order fields and Customer Profile Shipping fields are not saved.

I know this is normal, because failed validation in other tests could mean illegal entries.

For the postcode filter however, I'd still like to save data on failed validation. This will allow the client to see the user's input delivery address and telephone in order to make a call.

Any ideas how to go about this?

Ideas - Set to validate, but change order status - could this make it serve first checkout page?

1 Answer 1

0

You can can implement hook_form_alter in your custom module and add one more validation handler on top of validation handlers stack, so your is called first.

Inside your validation function follow the way the module Commerce Postal Code Filter is putting the validation, I assume it should be as simple as calling a function. Now if depending on what value it returns you can programmatially update current order status.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.