I have a problem with WooCommerce. I’m trying to add additional fields that will function only as validation. I don't want them to appear in the order summary, emails, etc. These are my example checkboxes, but I also have others that hide depending on whether someone selects something. Later in the summary, if not selected, it shows "No," and I don't want that to be visible at all. This is the new block-based WooCommerce.
woocommerce_register_additional_checkout_field(
array(
'id' => 'namespace/agree-terms',
'label' => 'I agree to the terms and conditions',
'location' => 'order',
'type' => 'checkbox',
)
);
woocommerce_register_additional_checkout_field(
array(
'id' => 'namespace/agree-marketing',
'label' => 'I agree to receive marketing emails',
'location' => 'order',
'type' => 'checkbox',
)
);