Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Membership › hide wcfm_products_filter_wrap wcfm_filters_wrap
- This topic has 5 replies, 3 voices, and was last updated 4 years ago by ing.rapparini.
- AuthorPosts
- March 26, 2020 at 7:18 pm #113344ing.rappariniParticipant
How to hide
wcfm_products_filter_wrap wcfm_filters_wrap
from the /store-manager/products
only for a certain vendor’s group? - April 2, 2020 at 10:21 pm #114833WCFM ForumKeymaster
Do you want to disable products list page filters for a certain group?
- April 2, 2020 at 10:33 pm #114836ing.rappariniParticipant
YES, EXACTLY!
- April 2, 2020 at 10:35 pm #114837ing.rappariniParticipant
The reason is because I have 18 custom taxonomimes…and the results is a too big product list page filters… I need it only for customers that have a certain membership that allow to have a lot of ads. Unuseful for who have 10 or 20 ads.
- April 3, 2020 at 1:12 pm #115017Sarmistha ChakrabortyKeymaster
Hello,
add_filter('wcfm_capability_settings_fields_settings_inside','fn_wcfm_capability_settings_fields_product_filter_hide',10,2); function fn_wcfm_capability_settings_fields_product_filter_hide($setting) { global $wp, $WCFM, $WCFMu, $WCFMgs, $wcfmgs_capability_manager_options; $product_search_hide = ( !empty( $wcfmgs_capability_manager_options['product_search_hide'] ) ) ? $wcfmgs_capability_manager_options['product_search_hide'] : ''; $setting['product_search_hide'] = array('label' => __('Product Filter', 'wc-frontend-manager-ultimate') , 'name' => 'wcfmgs_capability_manager_options[product_search_hide]','type' => 'checkboxoffon', 'class' => 'wcfm-checkbox wcfm_ele', 'value' => 'yes', 'label_class' => 'wcfm_title checkbox_title', 'dfvalue' => $product_search_hide); return $setting; } add_filter( 'wcfm_is_allow_bulk_edit','wcfm_product_filter_by_group'); add_filter( 'wcfm_is_products_custom_taxonomy_filter','wcfm_product_filter_by_group'); add_filter( 'wcfm_is_products_type_filter','wcfm_product_filter_by_group'); add_filter( 'wcfm_is_products_vendor_filter','wcfm_product_filter_by_group'); add_filter( 'wcfm_is_products_taxonomy_filter','wcfm_product_filter_by_group'); function wcfm_product_filter_by_group($bool){ global $wp, $WCFM, $WCFMu, $WCFMgs, $wcfmgs_capability_manager_options,$wcfm_capability; $current_user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() ); $current_plan = wcfm_get_membership(); if(isset($current_plan)) { $current_group = get_post_meta($current_plan,'associated_group',true); $group_capability_options = get_post_meta($current_group,'_group_capability_options',true); } $product_search_hide = ( isset( $group_capability_options['product_search_hide'] ) ) ? $group_capability_options['product_search_hide'] : ''; if($product_search_hide != '') { $bool = false; } return $bool; }
Add this code to your child theme’s functions.php
In case you do not have child theme then add code using this plugin – https://wordpress.org/plugins/code-snippets/And set the capability for each group.(PFA)
Thanks.
Attachments:
You must be logged in to view attached files. - April 3, 2020 at 2:02 pm #115029ing.rappariniParticipant
WOW Incredible!!! IT WORKS!
THANK YOU!
- AuthorPosts
- You must be logged in to reply to this topic.