Conditionally Remove Product Tabs for Certain Products

MultivendorX Pro

Resolved
Viewing 6 reply threads
  • Author
    Posts
    • #193803
      Chris
      Participant

      Hi support,

      I want to remove some product tabs which is not needed for my rental products, may I know which conditional statement is more suitable to use so that the code below will run when the products chosen are rental products?
      add_filter(‘wcmp_product_data_tabs’, ‘remove_tab_for_rental_product’, 10, 1);

      function remove_tab_for_rental_product ($tabs) {
      unset($tabs[‘shipping’]);
      unset($tabs[‘linked_product’]);
      unset($tabs[‘advanced’]);
      return($tabs);
      }

    • #193816

      Kindly add the below code in the functions.php file of your current active theme –

      
      add_filter('mvx_product_data_tabs', 'remove_tab_for_rental_product', 10, 1);
      function remove_tab_for_rental_product ($product_tabs) {
          array_push($product_tabs['shipping']['class'], 'hide_if_redq_rental');
          array_push($product_tabs['linked_product']['class'], 'hide_if_redq_rental');
          array_push($product_tabs['advanced']['class'], 'hide_if_redq_rental');
          return $product_tabs;
      }
      
      Copy
    • #193826
      Chris
      Participant

      Hi, thank you. One more question here, how do I set the Persons and Resources for Bookable products on vendor’s end? Because both tabs weren’t there and product data meta-box doesn’t have has persons and has resources options.

    • #193842

      There is some issue with bookings that is why the tabs are not coming in the product data meta box.
      Our team will provide you with the fix as soon as possible.

    • #193953
      Chris
      Participant

      Okay, noted. Thank you.

    • #193956

      Once we add the fix we will let you know.

    • #195763

      We have already fixed this issue. We are closing this thread. If you need help or face issue please open a new thread.

Viewing 6 reply threads

The topic ‘Conditionally Remove Product Tabs for Certain Products’ is closed to new replies.