• Resolved alisean87

    (@alisean87)


    will the front manager let me set required fields

    Condition
    Brand New
    Used
    Refurbished

    Brand
    Option

    Color
    Option

    dokan pro front doesn’t allow required fields

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author WC Lovers

    (@wclovers)

    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

    Thread Starter alisean87

    (@alisean87)

    attributes need these to be required

    Plugin Author WC Lovers

    (@wclovers)

    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

    Thread Starter alisean87

    (@alisean87)

    Hello,

    how do I add it sorry for late reply.

    thank you

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘WC Lovers Ultimate’ is closed to new replies.