Hi.
I am working on an integration between Woocommerce and Eventsorganiser Pro. For this purpose, I need to be able to show some information from Woocommerce to the admin only when the admin is viewing the booking (in the backend), but hide this information for users making the booking (in the frontend).
Is there any way of hiding form fields on the booking form in the frontend only?
Rgds,
Dariusz

Dariusz Miedzianogora
Hi Dariusz,
No – but you can display information to the admin on the bookings admin page without adding it to the booking form at all.
This simply involves registering a metabox:
//Register metabox
add_action( 'add_meta_boxes_event_page_bookings', 'my_register_bookings_metabox' );
function my_register_bookings_metabox(){
add_meta_box( 'my-metabox-id', 'My Metabox', 'my_metabox_callback' );
}
//Metabox callback
function my_metabox_callback( $booking ){
echo "Metabox content for {$booking->ID}";
}
Details on add_meta_box()
can be found here: http://codex.wordpress.org/Function_Reference/add_meta_box

Stephen Harris
Ah yes, thank you.
This works perfectly.
Sometimes the simple solutions are the most difficult to see 😀

Dariusz Miedzianogora
Hi Dariusz,
Did you get anywhere with your Woocommerce/EO integration? We might need to build something similar and I was wondering if you had managed to get anything working.
Cheers,
Andrew

Andrew Shankie