
Stephen Harris
So, scrap that. That needs to be called much earlier than init
Instead hook onto the template_redirect
hook (this is late enough, but not too late). And using eo_user_has_bookings( $user_id, get_the_ID())
you can call
remove_filter( 'the_content', 'eventorganiser_display_booking_table', 999 );
In a 2.1.1 you can use the above method instead (which would be preferable).

Stephen Harris
I split this off from http://wp-event-organiser.com/forums/topic/pro-allow-bookees-to-see-their-bookings/ as its an interesting question in its own right.
You can hook onto init
, and conditionally call:
add_filter( 'eventorganiser_pro_get_option_disable_automatic_form', '__return_true' );
to remove the booking section.

s2dd
Thanks, Stephen.
The next mini-challenge I face: my plugin lists a user’s bookings (per your suggestions in the source), and I’ve tweaked it so that it lists each event in a link so that you can click to go to the event page (to remind yourself where it’s taking place, for example).
Of course, if you click on the link, you’re presented with the event, with the booking form below it, and an advisory saying “you have already made a booking for this event”. I’m looking for a way to suppress the whole booking form if a user has already booked for it. I’ve found eo_user_has_bookings
in user-bookings.php, which I guess is the function I need to run to determine whether or not to switch off the booking form – but I can’t see how to turn off the booking form itself. Could you give me a clue, please?
Thanks as always!
John

Stephen Harris
Hi Tom,
There haven’t been any translations provided as of yet, but I have just published this page on translating Event Organiser.
Translations for the Event Organiser & Event Organiser Pro are handled separately – so most of the plug-in is probably being translated (since a Dutch translation for the standard version – albeit now and outdated one, has been provided).
Note: The POT file hasn’t been generated or included in the plug-in as of 2.1. You can generate it from source via Poedit. Otherwise, if using poeditor.com, you do not need to use the POT file.
If you wish to change the text, rather than just translate it, I’ll be publishing an article next week on how to do that.

Vilius Metelionis
Hi Stephen,
Sorry to bug you again about this, but I’m struggling a bit with getting Address form values. I’m using eo_get_booking_meta( $booking_id, 'meta_10', false);
to get the array from the address form. Every time it returns values in different order:
Array (
[0] => City
[1] => Line1
[2] => Province
[3] => Post Code )
Array (
[0] => Post Code
[1] => Line1
[2] => City
[3] => Province )
For some reason it also doesn’t include Country.
Thanks for your help.

Peter Smetsers
Hi,
I have a Dutch site. Everything from the organiser pro add-on works in Dutch, except apparently the booking form.
Here is an example:
http://www.adventist.nl/evenementen/evenement/summer-school-2013/
Where the booking form begins with:
Booking
You have already made a booking for this event.
You are logged in as tdebruin@adventist.nl. Not you?
Why is specifically this part not translated? How can I solve this?
Thanks,
Tom de Bruin

Stephen Harris
Yup, this is marked for 1.3 which will be focussing on booking form improvements. It’ll also add an api so that you can display the booking form anywhere in the template (or on a different page).

Dario
Currently EO Pro outputs the booking form right after the_content. I’d like to be able to shift this to a slightly different part of my page in order to improve the experience when using my custom theme.
thanks

Stephen Harris
Assuming $booking_data
is the an array you’re giving to the gateway then yes.
I’ll be updating the site with some documentation on (part of) the booking API (including eo_get_booking_meta()
. But you can use the following keys:
-
- bookee – The bookee ID. 0 if its a guest booking.
-
- bookee_first_name – The bookee’s first name
-
- bookee_last_name – The bookee’s last name (if provided).
-
- bookee_display_name – The bookee’s display name (as selected in profile).
-
- bookee_email – The bookee’s email address
-
- booking_notes – The booking notes
-
- event_id – The ID of the event the booking is for
-
- occurrence_id The ID of the occurrence the booking is for
-
- date – The date the booking was made
-
- ticket_quantity – The number of tickets contained in the booking
-
- booking_amount – The total amount the booking came to (as a float)
-
- meta_{$ID} – The value entered for booking form element with ID $ID.

Vilius Metelionis
Hi,
I am adding a new gateway to the plugin and for the gateway I want to include it is also mandatory to include bookee surname and event end date. I would also like to pass on some information from the form fields. How can I do that? Would it look something like this?
$booking_data['firstname'] = eo_get_booking_meta( $booking_id, 'bookee_display_name' );
$booking_data['surname'] = eo_get_booking_meta( $booking_id, 'bookee_display_surname' );
Thanks

Stephen Harris
I suppose the ICAL feed could be used here – but this is limited in what data it includes (no venue data / custom fields). You could use wp_remote_get()
to fetch the feed data, but you would then need to parse it (I’m currently working on providing a better api for parsing ICAL feeds – the current implementation is a bit tied to importing events).
Also I’m currently working on an API which allows apps to remotely fetch event/booking data (would require an API key). The aim for this is to allow for an app to fetch events / bookings and scan tickets at the door.
On the ‘host site’, I would use template_include
and determine (based on the query) whether your viewing a page or what the data sent in ICAL/json format and then include a template which displays the content in ICAL/json format. Then the ‘client site’ can use wp_remote_get()
to retrieve the data, and then parse the response. I would cache the result for performance too.

Stephen Harris
Being released this week! 🙂

Internal Communication
Hi there,
Is this feature possible yet ?
Thanks!
Anne-Claire