Hi there,
Thank you for contacting us and I'll be happy to assist.
We haven’t received the website’s access information with any of your tickets, but I’d like to share slightly updated code.
Can you please replace the old code from the active theme’s “functions.php” file, with this new one:
add_filter('cred_form_validate','validate_taxonomy_products',10,2);
function validate_taxonomy_products($error_fields, $form_data)
{
//field data are field values and errors
list($fields,$errors)=$error_fields;
//validate if specific form
if ($form_data['id']==25665)
{
//check if any product taxonomy term is selected
if (empty($fields['product-type']['value'][0]))
{
//set error message for empty product field
$errors['product-type'] = 'Please select a product';
}
}
//return result
return array($fields,$errors);
}
Note: please make sure that “25665” matches the actual form’s ID.
Also update the code in the form’s “JS Editor” to:
jQuery(document).ready(function($){
jQuery("select[name='product-type[]']").prepend('<option value="">--- Select Product ---</option>');
jQuery("select[name='product-type[]']")[0].selectedIndex = 0;
});
In case the issue still persists, you’re welcome to share temporary access (WP-Admin and FTP) to your site, in reply to this message.
This access will allow us to offer better help and check if some configurations might need to be changed.
Your next answer will be private which means only you and our support team will have access to it.
If you’re going to share the access details for the live/production website, it is very important that a complete backup of your database and website has been made.
Please let us know how it goes and if you have any further information or questions.
Regards,
Waqar