Required fields ignored
-
Hello!
We added some custom fields to checkout, that are required, but when the user pay by Apple Pay or Google Pay, they are ignored and not filled out by user.
We use this code to validate the fields:
// Validate delivery date and time fields
add_action('woocommerce_checkout_process', 'cwpai_validate_delivery_date_time_fields');
function cwpai_validate_delivery_date_time_fields()
{
if (isset($_POST['cwpai_delivery_date']) && empty($_POST['cwpai_delivery_date'])) {
wc_add_notice(('Please select a date, 'codewp'), 'error'); } if (isset($_POST['cwpai_delivery_time']) && empty($_POST['cwpai_delivery_time']) && empty($_POST['cwpai_specific_delivery_time'])) { wc_add_notice(('Please select an hour.', 'codewp'), 'error');
}
}Is there something we are missing?
Thank you,Simona
- You must be logged in to reply to this topic.