Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › Hiding certain fields
- This topic has 6 replies, 2 voices, and was last updated 6 years, 10 months ago by WCFM Forum.
- AuthorPosts
- January 11, 2018 at 1:43 pm #17761sharkmediasportParticipant
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 - January 11, 2018 at 3:45 pm #17772WCFM ForumMember
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
- January 11, 2018 at 3:55 pm #17773sharkmediasportParticipant
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 costand 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 - January 11, 2018 at 4:13 pm #17780WCFM ForumMember
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
- January 11, 2018 at 4:24 pm #17782sharkmediasportParticipant
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
- January 11, 2018 at 4:33 pm #17783sharkmediasportParticipant
Got it ! Needed label_class instead of desc_class
Thank you again for your amazing support !
- January 11, 2018 at 4:45 pm #17784WCFM ForumMember
Exactly, it should be “label_class”, you are really awesome!
Thank You
- AuthorPosts
- The topic ‘Hiding certain fields’ is closed to new replies.