From 22b30568889440360ac275ff46d881a9bda23998 Mon Sep 17 00:00:00 2001 From: girishpanchal30 Date: Fri, 13 Sep 2024 14:14:15 +0530 Subject: [PATCH] Fix field validation issue with non-required fields --- inc/woocommerce.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/woocommerce.php b/inc/woocommerce.php index 81d200ae..bced952e 100644 --- a/inc/woocommerce.php +++ b/inc/woocommerce.php @@ -228,12 +228,12 @@ function ppom_check_validation( $product_id, $post_data, $passed = true ) { continue; } - $passed = apply_filters( 'ppom_before_fields_validation', $passed, $field, $post_data, $product_id ); - - if ( $passed && ( ! isset( $field['required'] ) || 'on' !== $field['required'] ) ) { + if ( ! isset( $field['required'] ) || 'on' !== $field['required'] ) { continue; } + $passed = apply_filters( 'ppom_before_fields_validation', $passed, $field, $post_data, $product_id ); + if ( empty( $field['data_name'] ) && empty( $field['required'] ) &&