hide wcfm_products_filter_wrap wcfm_filters_wrap

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Membership hide wcfm_products_filter_wrap wcfm_filters_wrap

Viewing 5 reply threads
  • Author
    Posts
    • #113344
      ing.rapparini
      Participant

      How to hide
      wcfm_products_filter_wrap wcfm_filters_wrap
      from the /store-manager/products
      only for a certain vendor’s group?

    • #114833
      WCFM Forum
      Keymaster

      Do you want to disable products list page filters for a certain group?

    • #114836
      ing.rapparini
      Participant

      YES, EXACTLY!

    • #114837
      ing.rapparini
      Participant

      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.

    • #115017

      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.
    • #115029
      ing.rapparini
      Participant

      WOW Incredible!!! IT WORKS!
      THANK YOU!

Viewing 5 reply threads
  • You must be logged in to reply to this topic.