Stripe wrong custom checkout validation/notices (v.4.0.0)
-
Some custom validation (and related notices/errors) are not working properly from checkout only if Stripe is selected.
This happens to custom fields and regular fields (e.g. Order Notes).
You can test this in your functions.php:
// Validate a field from checkout testing with Stripe function checkout_order_comments_required() { if ( isset( $_POST['order_comments'] ) && empty($_POST['order_comments']) ) { wc_add_notice( sprintf( __( '%s is a required field.', 'woocommerce' ), '<strong>' . __( 'Order notes', 'woocommerce' ) . '</strong>' ) ,'error' ); } } add_action( 'woocommerce_checkout_process', 'checkout_order_comments_required' );
Related: https://docs.woocommerce.com/wc-apidocs/function-wc_add_notice.html
The fields are not validated until all fields where completed and correct payment data filled.
Later, the fields are validated and show in correct language, e.g.:
Notas del pedido es un campo requerido.
This works correct with other payment methods and with 3.2.3 version.
Does Stripe omit the validation of WC fields and validate the fields itself? It is necessary?
Thanks!
- The topic ‘Stripe wrong custom checkout validation/notices (v.4.0.0)’ is closed to new replies.