Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WCFM – Ultimate › Hide resources and persons tabs
- This topic has 15 replies, 3 voices, and was last updated 3 years, 1 month ago by
Sushobhan.
- AuthorPosts
- January 16, 2020 at 11:46 pm #102344
paattal
ParticipantHello,
On edit product I force to ‘0’ and hide “Has resources” + “Has persons” checkboxes but before update product, resources and persons tabs are displayed.
How hidden those 2 tabs on first update ?
Thank you
- January 17, 2020 at 7:13 pm #102480
Sushobhan
KeymasterHello,
First tell me, how you hide the checkboxes “Has resources” + “Has persons” for bookable product? I guess you want to permanently hide those two tabs for Bookable product.
Let me know.Thanks
- January 19, 2020 at 11:57 pm #102745
paattal
ParticipantHello,
Yes I want permanently hide those two tabs and I use this snippet :
add_filter( 'wcfm_product_manage_fields_general', 'wcfmbi_product_manage_fields_general', 100, 3 ); function wcfmbi_product_manage_fields_general( $general_fields, $product_id, $product_type ) { global $WCFM, $WCFMpb; 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'; $general_fields['_wc_booking_has_resources']['dfvalue'] = 'no'; } if( isset( $general_fields['_wc_booking_has_persons'] ) ) { $general_fields['_wc_booking_has_persons']['class'] = 'wcfm_custom_hide'; $general_fields['_wc_booking_has_persons']['desc_class'] = 'wcfm_custom_hide'; $general_fields['_wc_booking_has_persons']['dfvalue'] = 'no'; } return $general_fields; }
Thank you
- January 20, 2020 at 4:56 pm #102860
Sushobhan
KeymasterHello,
Use the following code instead-add_filter( 'wcfm_product_manage_fields_general', 'wcfmbi_product_manage_fields_general', 100, 3 ); function wcfmbi_product_manage_fields_general( $general_fields, $product_id, $product_type ) { global $WCFM, $WCFMpb; if( isset( $general_fields['_wc_booking_has_resources'] ) ) { unset($general_fields['_wc_booking_has_resources']); } if( isset( $general_fields['_wc_booking_has_persons'] ) ) { unset($general_fields['_wc_booking_has_persons']); } return $general_fields; }
Let me know how this goes.
- January 24, 2020 at 6:25 pm #103623
- January 24, 2020 at 7:03 pm #103638
- January 27, 2020 at 6:02 pm #104195
Sushobhan
KeymasterCan you please share a temporary access of your site so that we can debug this. Also, don’t forget to mark your reply as private.
- January 27, 2020 at 7:22 pm #104211
paattal
ParticipantThis reply has been marked as private. - January 27, 2020 at 7:29 pm #104212
paattal
ParticipantThis reply has been marked as private. - January 28, 2020 at 7:32 pm #104406
Sushobhan
KeymasterHi,
The two tabs ‘Resources’ and ‘Persons’ are removed now. For this the following code snippet is also added –function remove_booking_tabs() { global $WCFMu; remove_action( 'end_wcfm_products_manage', array( $WCFMu->wcfmu_wcbooking, 'wcb_wcfmu_products_manage_form_load_views' ), 30 ); } add_action( 'wcfm_init', 'remove_booking_tabs', 20 );
Will update you on rest of the things.
- January 28, 2020 at 8:34 pm #104409
paattal
ParticipantNice, thank you very much !
Is it possible to do the same thing and add lines to hide attached tabs : [Location] Geo My Wp, [Yoast SEO] and [Tabs Manager] Woocommerce
-> [Location] is only for grouped products and [Yoast SEO] + [Tabs Manager] are accessible only for admin.
Attachments:
You must be logged in to view attached files. - January 31, 2020 at 4:16 pm #104791
Sarmistha Chakraborty
KeymasterHello,
[Location] is only for grouped products
>> Override the template wcfm-view-geomywp-products-manage.php in your theme’s<your active theme>/wcfm/products-manager/wcfm-view-geomywp-products-manage.php
.
and remove the class name “variable external booking”. (PFA)[Yoast SEO] + [Tabs Manager] are accessible only for admin
>>Modify the script,function remove_booking_tabs() { global $WCFMu, $WCFM; remove_action( 'end_wcfm_products_manage', array( $WCFMu->wcfmu_wcbooking, 'wcb_wcfmu_products_manage_form_load_views' ), 30 ); if(!current_user_can('administrator')) { add_filter('wcfm_is_allow_seo','__return_false'); add_filter('wcfm_is_allow_wc_tabs_manager','__return_false'); } } add_action( 'wcfm_init', 'remove_booking_tabs', 20 );
Attachments:
You must be logged in to view attached files. - January 31, 2020 at 4:46 pm #104795
paattal
ParticipantHello,
Really perfect ! WC Lovers is obviously the best support team !
I include somme features since my last post and I need now to hide also Catalog Tab because I actvate/deactivate and hide all fields.
Sorry, this is my last request on this topic what is the syntax filter to add to this code ?
Thank you
- February 4, 2020 at 6:56 pm #105413
Sushobhan
KeymasterHello,
You can use the following snippet to achieve the same –function remove_product_tabs() { global $WCFMu; remove_action( 'end_wcfm_products_manage', array( $WCFMu->wcfmu_wcbooking, 'wcb_wcfmu_products_manage_form_load_views' ), 30 ); if ( ! current_user_can( 'administrator' ) ) { add_filter( 'wcfm_is_allow_seo', '__return_false' ); add_filter( 'wcfm_is_allow_wc_tabs_manager', '__return_false' ); } } add_action( 'wcfm_init', 'remove_product_tabs', 20 ); function remove_catalog_tab() { add_filter( 'wcfm_is_allow_catalog', '__return_false' ); } add_action( 'init', 'remove_catalog_tab', 9 );
Let me know how it goes.
Thanks - February 4, 2020 at 7:28 pm #105419
paattal
ParticipantHello,
Nice thank you 🙂
- February 4, 2020 at 9:55 pm #105436
Sushobhan
KeymasterHello,
You are always welcome 🙂Let me know if there’s anything else we can help you with.
Can we ask for a favor? Would you mind taking a few minutes to review our plugin at https://wordpress.org/support/plugin/wc-multivendor-marketplace/reviews/ and let others know about your 5 Star experience with WCFM Marketplace. Also, follow us on Twitter https://twitter.com/wcfmmp for more exciting news, important updates, and irresistible offers.
Thanks!
- AuthorPosts
- You must be logged in to reply to this topic.