In woocommerce checkout page need to remove a specific custom field validation. This field is basically generated by a plugin using woocommerce_form_field().Is there any way to remove the validation for that specific field?The piece of code block
echo '<div id="woo_delivery_delivery_selection_field" style="display:none;">';
woocommerce_form_field('woo_delivery_delivery_selection_box',
[
'type' => 'select',
'class' => [
'woo_delivery_delivery_selection_box form-row-wide'
],
'label' => __($delivery_option_field_label, 'woo-delivery'),
'placeholder' => __($delivery_option_field_label, 'woo-delivery'),
'options' => Woo_Delivery_Delivery_Option::delivery_option($delivery_option_settings),
'required' => true,
'custom_attributes' => [
'data-no_result_notice' => __($no_result_notice, 'woo-delivery'),
],
], WC()->checkout->get_value('woo_delivery_delivery_selection_box'));
echo '</div>'
2
Answers
you need to test the code like it into your
functions.php
of child or active themeActually we need use filter hook woocommerce_checkout_fields and need to modified based on billing,shiping,account,orders.
For more details you may visit https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/
thank you