has person : Pre checked + hide it

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 Bookings has person : Pre checked + hide it

Viewing 1 reply thread
  • Author
    Posts
    • #37774
      acaua ferreira
      Guest

      How to pre check ‘has person’, and hide it ?

      I tried an old code found here on forum, but broked my site. What i did of wrong?

      function wcfm_2510_product_manage_fields_general( $general_fields, $product_id, $product_type ) {
      global $WCFM;

      if( !$product_id ) {
      if( isset( $general_fields[‘_wc_booking_has_resources’] ) ) {
      $general_fields[‘_wc_booking_has_resources’][‘dfvalue’] = ‘yes’;
      }

      if( isset( $general_fields[‘_wc_booking_has_persons’] ) ) {
      $general_fields[‘_wc_booking_has_persons’][‘dfvalue’] = ‘yes’;
      }
      }

      return $general_fields;
      }
      add_filter( ‘wcfm_product_manage_fields_general’, ‘wcfm_2510_product_manage_fields_general’, 100, 3 );

    • #37803
      WCFM Forum
      Member

      Hi,

      Please use this code for the purpose –

      function wcfm_custom_2411_product_manage_fields_general( $general_fileds, $product_id, $product_type ) {
      	global $WCFM;
      	
      	if( isset( $general_fileds['_wc_booking_has_resources'] ) ) {
      		$general_fileds['_wc_booking_has_resources']['dfvalue'] = 'yes';
      	}
      	if( isset( $general_fileds['_wc_booking_has_persons'] ) ) {
      		$general_fileds['_wc_booking_has_persons']['dfvalue'] = 'yes';
      	}
      	return $general_fileds;
      }
      add_filter( 'wcfm_product_manage_fields_general', 'wcfm_custom_2411_product_manage_fields_general', 150, 3 );

      Thank You

Viewing 1 reply thread
  • The topic ‘has person : Pre checked + hide it’ is closed to new replies.