Show/Hide Menu Tabs Based on Product Type

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 WC Appointment Show/Hide Menu Tabs Based on Product Type

Viewing 9 reply threads
  • Author
    Posts
    • #25409
      Sean Mac
      Participant

      Hi,

      Is there any way to show/hide tabs based on the product type? When a vendor selects “Appointable product” from the frontend dashboard, I don’t want them to see certain menu tabs like “Inventory” and “Shipping”. For some reason, this is confusing to them no matter how many times I explain it.

      Thank you in advance!

    • #25458
      WCFM Forum
      Member

      Hi,

      Frankly, there is no such setting for these.

      Actually, product tabs are automatically adjusted as product type changed. And it follow the same rule as in wp-admin -> add product.

      Though for WCfM this can be manageable at a certain level. Add this code to your site and it will disable “Inventory” tab for Appointment product type –

      function wcfm_pm_block_custom_class( $classes ) {
      	$classes .= 'non-appointment';
      	return $classes;
      }
      add_filter( 'wcfm_pm_block_custom_class_stock', 'wcfm_pm_block_custom_class' );
      add_filter( 'wcfm_pm_block_custom_class_shipping', 'wcfm_pm_block_custom_class' );

      Thank You

    • #25489
      Sean Mac
      Participant

      I tried the code you suggested but that doesn’t work. I’ve being trying to solve this now for 2 weeks and nothing seems to work. I will keep digging around for a solution because I really need to fix this. I really appreciate your assistance!

    • #25494
      WCFM Forum
      Member

      Hi,

      is this code does not disable “Inventory” tab for Appointment products?

      What is your WCfM version?

      Thank You

    • #25519
      Sean Mac
      Participant

      Sorry for the delayed response. I saw an update notification and I’m now operating on version 4.1.6. The code you suggested works but unfortunately, it still doesn’t solve my issue because “Inventory” is not the only tab I need to hide for appointment product types.

      Thanks again for your time and I’ll keeping looking for a solution.

    • #25524
      WCFM Forum
      Member

      Hi,

      Can you please know me which are the other tabs you want to hide?

      Thank You

    • #25564
      Sean Mac
      Participant

      I would like to hide the following tabs when a vendor selects “Appointable product”:

      Inventory
      Shipping
      Attributes

    • #25594
      WCFM Forum
      Member

      Hi,

      Here is your full code for the purpose –

      function wcfm_product_manage_28_custom_virtual( $general_fields, $product_id, $product_type ) {
      	if( isset( $general_fields['is_virtual'] ) ) {
      	  $general_fields['is_virtual']['class'] .= ' non-appointment';
      	  $general_fields['is_virtual']['desc_class'] .= ' non-appointment';
      	}
      	return $general_fields;
      }
      add_filter( 'wcfm_product_manage_fields_general', 'wcfm_product_manage_28_custom_virtual', 50, 3 );
      function wcfm_pm_block_custom_class( $classes ) {
      	$classes .= 'non-appointment';
      	return $classes;
      }
      add_filter( 'wcfm_pm_block_custom_class_stock', 'wcfm_pm_block_custom_class' );
      add_filter( 'wcfm_pm_block_custom_class_shipping', 'wcfm_pm_block_custom_class' );
      add_filter( 'wcfm_pm_block_custom_class_attributes', 'wcfm_pm_block_custom_class' );

      Thank You

    • #25623
      Sean Mac
      Participant

      THANK YOU SO MUCH!

      I was so reluctant about asking for this functionality in this forum because honestly this plugin is already awesome and I didn’t want to be greedy. 🙂

      Again, I REALLY appreciate this. THANKS!!!

    • #25624
      WCFM Forum
      Member

      You are welcome 🙂

      Feel free to reach us anytime for any help.

      Between, really thanks for the review, really pleasure 🙂

      Thanks again!

Viewing 9 reply threads
  • The topic ‘Show/Hide Menu Tabs Based on Product Type’ is closed to new replies.