Hiding certain fields

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!

Viewing 6 reply threads
  • Author
    Posts
    • #17761
      sharkmediasport
      Participant

      Hi,

      I would like to be able to hide fields in the dashboard, can you provide any code for this. Is it possible to have a kind of how to for this so that I can hide more fields on my own if necessary in the futur ?

      Thank you !
      JF

    • #17772
      WCFM Forum
      Member

      Hi,

      It’s absolutely possible to achieve, but please never edit any WCFM core files.

      WCFM all form fields are generated using structured array and passing through a filter to modify as per requirement.

      Hope you already see the code in your another thread and have the idea how easy it is!

      Please know me which fields you want to hide!

      Thank You

    • #17773
      sharkmediasport
      Participant

      Yeah, I saw it in another thread, maybe you can tell me how to find field php name so I can do it myself.

      For exmaple I wnat to hide:

      Base cost
      Display cost

      and potentially
      Requires confirmation?
      Can be cancelled?

      I already have this to hide “resources”

      function wcb_custom_product_manage_fields_general( $general_fields, $product_id, $product_type ) {
      if( wcfm_is_vendor() ) {
      if( isset( $general_fields[‘_wc_booking_has_resources’] ) ) {
      $general_fields[‘_wc_booking_has_resources’][‘class’] .= ‘ wcfm_custom_hide’;
      $general_fields[‘_wc_booking_has_resources’][‘desc_class’] .= ‘ wcfm_custom_hide’;
      }
      }
      return $general_fields;
      }
      add_filter( ‘wcfm_product_manage_fields_general’, ‘wcb_custom_product_manage_fields_general’, 100, 3 );

      Thank you
      JF

    • #17780
      WCFM Forum
      Member

      Hi,

      Ahhh … that’s brilliant, you are already at the right track.

      Let me help you for the other fields, kindly check this file – “wc-frontend-manager\views\products-manager\wcfm-view-wcbookings-products-manage.php” at line 84
      And here your filter will be “wcfm_wcbokings_cost_fields”, hope rest you can do yourself.

      Feel free to reach me for any further assistance.

      Thank You

    • #17782
      sharkmediasport
      Participant

      This code was from you guys 😉

      Can’t seem to have working for booking_cost, I think I’ll need some help for this one.

      So far…

      //Remove cost fields from WCFM manager FE
      function wcb_custom_product_manage_booking_cost_fields( $booking_cost_fields ) {
      if( wcfm_is_vendor() ) {
      if( isset( $booking_cost_fields[‘_wc_booking_cost’] ) ) {
      $booking_cost_fields[‘_wc_booking_cost’][‘class’] .= ‘ wcfm_custom_hide’;
      $booking_cost_fields[‘_wc_booking_cost’][‘desc_class’] .= ‘ wcfm_custom_hide’;
      }
      }
      return $booking_cost_fields;
      }
      add_filter( ‘wcfm_wcbokings_cost_fields’, ‘wcb_custom_product_manage_booking_cost_fields’, 100, 3 );

      thank you

    • #17783
      sharkmediasport
      Participant

      Got it ! Needed label_class instead of desc_class

      Thank you again for your amazing support !

    • #17784
      WCFM Forum
      Member

      Exactly, it should be “label_class”, you are really awesome!

      Thank You

Viewing 6 reply threads
  • The topic ‘Hiding certain fields’ is closed to new replies.