Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › How to make custom taxonomy/category required ?
Tagged: taxonomy
- This topic has 4 replies, 2 voices, and was last updated 6 years, 5 months ago by WCFM Forum.
- AuthorPosts
- June 12, 2018 at 11:33 pm #24740d-n-13Participant
Hello wcfm team,
I’ve added some custom categories, is there a way to make them required ?
See screenshots:
https://ibb.co/kCFovJ
https://ibb.co/eCuRhy
https://ibb.co/j8Hq9d
https://ibb.co/mHJV9dIt’s really important to me.
Thanks!
- June 13, 2018 at 7:47 am #24748WCFM ForumMember
Hi,
I understand your requirement and we will definitely add support of custom taxonomy validation option in next update.
Thank You
- June 13, 2018 at 12:10 pm #24759d-n-13Participant
Hi, thank you for your response,
This is a good news thanks !
Also, is it possible to get a temporary solution ? I tried to customize some of the code, I managed to show a red star on my custom taxonomy but I can still add products without choosing anything.
wc-frontend-manager-ultimate/core/class-wcfmu-custom-validation.php
<?php
$WCFM->wcfm_fields->wcfm_generate_form_field( apply_filters( ‘wcfm_custom_validation_taxonomy_elements’,
array( “wcfmcr_featured_img” => array(‘label’ => __(‘Featured Image’, ‘wc-frontend-manager-ultimate’) , ‘name’ => ‘wcfm_custom_validation_options[featured_img]’,’type’ => ‘checkbox’, ‘class’ => ‘wcfm-checkbox wcfm_ele’, ‘value’ => ‘yes’, ‘label_class’ => ‘wcfm_title checkbox_title’, ‘dfvalue’ => isset( $this->wcfm_custom_validation_options[‘featured_img’] ) ? ‘yes’ : ‘no’ ),
“wcfmcr_product_cat” => array(‘label’ => __(‘Categories’, ‘wc-frontend-manager’) , ‘name’ => ‘wcfm_custom_validation_options[product_cat]’,’type’ => ‘checkbox’, ‘class’ => ‘wcfm-checkbox wcfm_ele’, ‘value’ => ‘yes’, ‘label_class’ => ‘wcfm_title checkbox_title’, ‘dfvalue’ => isset( $this->wcfm_custom_validation_options[‘product_cat’] ) ? ‘yes’ : ‘no’ ),“wcfmcr_product_cat2” => array(‘label’ => __(‘Categories’, ‘wc-frontend-manager’) , ‘name’ => ‘wcfm_custom_validation_options[cities]’,’type’ => ‘checkbox’, ‘class’ => ‘wcfm-checkbox wcfm_ele’, ‘value’ => ‘yes’, ‘label_class’ => ‘wcfm_title checkbox_title’, ‘dfvalue’ => isset( $this->wcfm_custom_validation_options[‘cities’] ) ? ‘yes’ : ‘no’ ),
“wcfmcr_product_tags” => array(‘label’ => __(‘Tags’, ‘wc-frontend-manager’) , ‘name’ => ‘wcfm_custom_validation_options[product_tags]’,’type’ => ‘checkbox’, ‘class’ => ‘wcfm-checkbox wcfm_ele’, ‘value’ => ‘yes’, ‘label_class’ => ‘wcfm_title checkbox_title’, ‘dfvalue’ => isset( $this->wcfm_custom_validation_options[‘product_tags’] ) ? ‘yes’ : ‘no’ ),
)
) );
?>Kind regards
- June 13, 2018 at 3:30 pm #24763WCFM ForumMember
Hi,
OK, I am sending you two updated files. Just place those at proper position and remove these custom codes.
Two files –
1. wc-frontend-manager-ultimate/core/class-wcfmu-custom-validation.php
2. wc-frontend-manager/core/class-wcfm-library.phpThank you
- June 17, 2018 at 11:57 am #25001WCFM ForumMember
Hi,
WCfM 4.1.4 has just released.
It comes with this feature in-build.
Kindly update yours and take a look.
Thank You
- AuthorPosts
- The topic ‘How to make custom taxonomy/category required ?’ is closed to new replies.