HI,
Thanks for get in touch with us.
Well, WCFM Ultimate has a module to set product manager fields required – https://ibb.co/Qjm1tmy
But that works for default fields.
Condition
Brand New
Used
Refurbished
Brand
Option
Color
Option
– Now, what these fields are? Attributes or custom taxonomies!
It will be good to guide you if you show me screenshot of your product manager.
Thank You
attributes need these to be required
Hi,
Use this code –
add_filter( 'wcfm_product_custom_attributes', function( $taxonomy_fields, $att_taxonomy ) {
if( isset( $taxonomy_fields[$att_taxonomy] ) && isset( $taxonomy_fields[$att_taxonomy]['options'] ) ) {
if( isset( $taxonomy_fields[$att_taxonomy]['options']['is_active'] ) ) {
$taxonomy_fields[$att_taxonomy]['options']['is_active']['custom_attributes'] = array( 'required' => 1, 'required_message' => 'Attributes are required' );
}
if( isset( $taxonomy_fields[$att_taxonomy]['options']['value'] ) ) {
$taxonomy_fields[$att_taxonomy]['options']['value']['custom_attributes'] = array( 'required' => 1, 'required_message' => 'Attributes are required' );
}
}
return $taxonomy_fields;
}, 50, 2);
Thank You
Hello,
how do I add it sorry for late reply.
thank you