1
votes

I can unset fields from billing and shipping but why I can't unset fields from additional field section. I am adding a condition on these fields. Maybe I am using wrong meta keys.

function wc_remove_checkout_field( $fields ) {
    unset( $fields['billing']['test_field'] ); //this one working
    unset( $fields['additional']['delivery_time'] ); //this one not even if I replace additional with order.


    return $fields;
}
add_filter( 'woocommerce_checkout_fields' , 'wc_remove_checkout_field' );

Creating fields usings this plugin WooCommerce Checkout Field Editor

1

1 Answers

0
votes

You can use this filter to remove the order notes field:

add_filter('woocommerce_enable_order_notes_field', '__return_false');

If you want to stick with your method using unset, you need to replace "additional" with "order":

unset($fields['order']['order_comments']);