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
Vilius Metelionis
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.
Stephen Harris
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.
Vilius Metelionis
Hi Vilius,
I’ve fixed the country data not saving bug, and will update this in the next version.
I’m surprised by the re-ordering, but the way the address is saved could be handled better. Either it should be stored as serialised (associative) array, or else, retrieved by specifying the part of the address: meta_10_street-address
, meta_10_2nd-line
, meta_10_city
, meta_10_state
etc.
I’ll have think an include the fix(es) in 2.1.1 sometime next week.
Stephen Harris
I’ve tried to ensure that the array returns the address in the correct order, but it cannot be guaranteed (though I’ve been able to replicate the bug).
However in the next update you can use meta_10_street-address
etc as key to access specifically the street address (for example).
I’ll be releasing 1.1.1 in the next day or two.
Stephen Harris