Make field required
-
Hi I have this code in function.php
add_filter( 'woocommerce_billing_fields' , 'make_order_notes_required_field' ); function make_order_notes_required_field( $fields ) { // Set in the array your targeted product category term(s) $categories = array("company"); if ( is_product_category_terms_in_cart( $categories ) ) { $fields['billing_company']['required'] = true; } return $fields; }It make Company name field required when “company” category product is in cart. And it works fine. But when I instaled your plugin (to add custom field) code stopped working. I tried “_billing_company” meta but without succes. How to make it work again with your plugin?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Make field required’ is closed to new replies.