Plugin Support
Dina S.
(@themehighsupport)
Hi,
Could you please temporarily deactivate our plugin and verify it from your side. If the issue still persists then this issue is not related to our plugin. If the issue is getting resolved after deactivating our plugin then please do let us know.
Thank you!
We have deactivated your plugin, and the issue is resolved. However, when we reactivate your plugin to add additional fields to our checkout forms, the issue reappears. Specifically, form fields from your plugin, other than input type text, do not display any form errors to the user. For instance, we have a required select dropdown. If the user does not select an option and submits the checkout form, there is no indication that this dropdown is required—no red borders, no text indicating the requirement, nothing. All other checkout form input fields indicate errors, but the input fields from your plugin do not.
Plugin Support
Dina S.
(@themehighsupport)
Your issue needs a detailed check. Can you please raise a ticket through our website? We hope our technical team will be able to help you.
Thank you!
Plugin Support
Dina S.
(@themehighsupport)
We have fixed the issue by adding the below code snippet.
add_action('wp_footer', 'th_add_red_border');
function th_add_red_border(){
?>
<script type="text/javascript">
(function($){
$(document).on('checkout_error', function(event, errors){
var datetime_value = $('input[type="datetime-local"]').val();
const datetime_wrapper = $('input[type="datetime-local"]').closest( '.validate-required' );
check_value_exists(datetime_value, datetime_wrapper);
var time_value = $('input[type="time"]').val();
const time_wrapper = $('input[type="time"]').closest( '.validate-required' );
check_value_exists(time_value, time_wrapper);
});
$('select,input[type="datetime-local"],input[type="time"]').on('change', function(){
const wrapper = $(this).closest( '.validate-required' );
var selected_value = $(this).val();
check_value_exists(selected_value, wrapper);
});
function check_value_exists(selected_value,wrapper){
setTimeout( function(){
if( selected_value == null || selected_value == '') {
wrapper.addClass('woocommerce-invalid'); // error
} else {
wrapper.addClass( 'woocommerce-validated' ); // success
wrapper.removeClass( 'woocommerce-invalid' ); // success
}
}, 1000 );
}
})(jQuery, window, document)
</script>
<?php
}
Thank you!