Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Bookings › has person : Pre checked + hide it
- This topic has 1 reply, 2 voices, and was last updated 6 years ago by WCFM Forum.
- AuthorPosts
- November 24, 2018 at 1:33 am #37774acaua ferreiraGuest
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 ); - November 24, 2018 at 4:44 am #37803WCFM ForumMember
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
- AuthorPosts
- The topic ‘has person : Pre checked + hide it’ is closed to new replies.