Hiding Fields/Options in "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 Hiding Fields/Options in "Add Product" page

Viewing 6 reply threads
  • Author
    Posts
    • #20023
      Jay
      Guest

      Hi,

      I would like to hide some fields for vendors when they add/edit product.
      Specifically, Menu Order from Advanced tab and Up-sell option from Linked tab.

      Can you provide code snippet to do this?

      Thank you!

    • #20029
      Bingal
      Keymaster

      Hi,

      Please first go through WCFM Capability, you may disable many of them from there.

      Still if you have anything left, then please know me, will definitely give you code snippet for the purpose.

      Thank You

    • #20042
      Jin
      Guest

      I’ve went through the capability setting, I cannot disable individual field I listed.

      For example, I can disable whole “Linked” tab but I cannot disable “upsell” option within “Linked” tab.

    • #20047
      WCFM Forum
      Keymaster

      Hi,

      Don’t worry, I will give you code for those.

      Here is one for hiding “Menu Order” from Advanced tab –

      function wcfm_product_manage_fields_advanced_manipulate( $advanced_fields, $product_id ) {
      	if( wcfm_is_vendor() && isset( $advanced_fields['menu_order'] ) ) {
      		$advanced_fields['menu_order']['class'] = 'wcfm_custom_hide';
      		$advanced_fields['menu_order']['label_class'] = 'wcfm_custom_hide';
      	}
      	return $advanced_fields;
      }
      add_filter( 'wcfm_product_manage_fields_advanced', 'wcfm_product_manage_fields_advanced_manipulate', 50, 2 );

      Thank You

    • #20049
      WCFM Forum
      Keymaster

      Hi,

      Here is the code for hiding “Up sells” option –

      function product_manage_fields_linked_manipulate( $linked_fields, $product_id, $products_array ) {
      	if( wcfm_is_vendor() && isset( $linked_fields['upsell_ids'] ) ) {
      		unset( $linked_fields['upsell_ids'] );
      	}
      	return $linked_fields;
      }
      add_filter( 'product_manage_fields_linked', 'product_manage_fields_linked_manipulate', 50, 3 );

      Thank You

    • #20051
      Jin
      Guest

      Thank you so much for your help!

      It is now working as I wanted.

    • #20068
      Bingal
      Keymaster

      Great … welcome 🙂

Viewing 6 reply threads
  • The topic ‘Hiding Fields/Options in "Add Product" page’ is closed to new replies.