If you have set a minimum or maximum value for your number field, it will try to validate this whether or not the field is required.
This means that if you have entered a minimum of 5 and the user leaves the field empty, there will still be a validation error if the user tries to add the product to the cart – even though the field is not required.
To ensure that number fields can be left empty even if they have a minimum or maximum value, and prevent validation on a non-required number field, add this to your functions.php file or snippets file:
|// Add this if you want to prevent non-required number fields from validating min or max values|
|add_filter( 'pewc_only_validate_number_field_value_if_field_required', '__return_true' );|