Completely hide restricted categories from vendor's "add product" page

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 – Groups & Staffs Completely hide restricted categories from vendor's "add product" page

Viewing 13 reply threads
  • Author
    Posts
    • #22731
      Kristin Rutten
      Guest

      I have restricted the allowed categories by product type for specific vendor groups, but need to know how to make those disallowed categories totally disappear from the category selection list on the page where a vendor adds a new product. For example, I do not want “Uncategorized” to show up at all on the list … only the categories that can be chosen should appear. I also have a few other categories that are for use by site admin only and I don’t want those to appear on the list.

      I am using WCFM and all of the premium add-ons along with WC Marketplace.

    • #22755
      WCFM Forum
      Keymaster

      Hi,

      WCfM product manager category select has two views – checklist and select2

      In checklist view all categories listed, if not allowed then checkbox not visible.

      But in select2 (drop-down) view only allowed categories visible.

      You may just take a try the second one, have this option at WCfM Admin Setting -> Dashboard -> Disable Category checklist view

      Thank You

    • #22759
      kristin.rutten
      Participant

      Thank you. That works, though I would prefer the checkbox option if it were possible to hide the disallowed categories through a snippet or other method. The dropdown method doesn’t show the hierarchy of main categories & subcategories unless the main categories are allowed for selection, which means I can’t force vendors to choose a subcategory instead of the main category.

    • #22826
      WCFM Forum
      Keymaster

      Understand. We will change this logic in next update.

      Thank You

    • #22934
      Kristin Rutten
      Guest

      Thanks… the most recent update was helpful because I can now use the checkboxes without having the disallowed categories showing on the list.

      The only feature missing that I was hoping for was to be able to prevent selection of the main category if subcategories are available. For example, if I have Main Category A and Subcategories 1, 2 and 3, I would like to prevent the vendor from choosing Main Category A, forcing them to choose one or more of the subcategories instead.

      (Also, unrelated but THANK YOU for adding the option of limiting Featured Products!! Very helpful!)

    • #22970
      WCFM Forum
      Keymaster

      Hi,

      This is also possibly to do.

      I will provide you some code for this.

      Thank You

    • #22971
      Kristin
      Guest

      That would be great… thanks!

    • #23007
      WCFM Forum
      Keymaster

      Hi,

      Here is your custom code for the purpose –

      function wcfm_pm_custom_script( $end_point ) {
      	switch( $end_point ) {
      		case 'wcfm-products-manage':
      			?>
      			<script>
      			jQuery(document).ready(function($) {
      				$('#product_cats_checklist').children('.product_cats_checklist_item').each(function() {
      					 $(this).children('label').children('input').addClass('wcfm_custom_hide');
      				});
      			});
      			</script>
      		<?php
      		break;
        }
      }
      add_action( 'after_wcfm_load_views', 'wcfm_pm_custom_script' );

      Please know me is this works for you or not!

      Thank You

    • #23009
      Kristin
      Guest

      Thanks! That seems to do the trick – the only issue is if there is a main category that has no subcategories because the main category still cannot be selected. (I should be able to work around that if I have to.)

    • #23011
      WCFM Forum
      Keymaster

      ha ha ha .. first I written code like that to allow non-children main categories and then change to this.
      Anyway, use this –

      function wcfm_pm_custom_script( $end_point ) {
      	switch( $end_point ) {
      		case 'wcfm-products-manage':
      			?>
      			<script>
      			jQuery(document).ready(function($) {
      				$('#product_cats_checklist').children('.product_cats_checklist_item').each(function() {
      					if( $(this).children('.product_taxonomy_sub_checklist').length > 0 ) {
      					  $(this).children('label').children('input').addClass('wcfm_custom_hide');
      					}
      				});
      			});
      			</script>
      		<?php
      		break;
        }
      }
      add_action( 'after_wcfm_load_views', 'wcfm_pm_custom_script' );

      Thank You

    • #23012
      Kristin
      Guest

      Perfect!! Thanks so much!

    • #23015
      WCFM Forum
      Keymaster

      Welcome 🙂

      Well, if you ever get a chance then please add a review for me – https://wordpress.org/support/plugin/wc-frontend-manager/reviews/

      Thank You

    • #23016
      Kristin
      Guest

      Will do! 🙂

    • #23017
      WCFM Forum
      Keymaster

      Thanks a lot 🙂

Viewing 13 reply threads
  • The topic ‘Completely hide restricted categories from vendor's "add product" page’ is closed to new replies.