
Benoit David
Hi,
I’m trying to replace the default form (which i removed successfully with your code in functions.php).
But simply putting [event_booking_form] does nothing.
I’d like to try to specify the event_id, but dont know where to find it.
The page is at : http://katalyst5.com/wp/learn/fr/events/event/maximize-your-linkedin-4hrs/?preview=true&preview_id=100&preview_nonce=8bb6f67c5f
Thank you!

Robert Marsden
Hi, we’re hosting a “virtual convention” for a number of Role-Playing and Board Games, and Event Organiser has been a god-send.
But I’ve got a strange problem. We’re outputting the event capacity and and tickets remaining data, using eo_get_event_capacity and eo_get_remaining_tickets_count and one of our events always returns ‘0’ for the event capacity. All our other events, from all categories, return both fields as expected, only this event.
We are doing the output within the tickets loop in the eo-ticket-picker.php template and the code we are using to output the capacity is:
eo_get_event_capacity($booking_form->get('event_id'));
- Deleting and re-creating the event seems to have no effect, even when the event title and ticket name/count is changed.
- Changing the number of tickets and “cap bookings” seems to have no effect, yet the remaining tickets count works fine.
- Changing the venue also has no effect.
- Again, this works perfectly in all events but this one.
The problem event is located here: http://www.gamergeekend.org/events/event/civilization/
All events can be found here: http://www.gamergeekend.org/events/
Any help on figuring this out would be much appreciated.
-
This topic was modified 10 years, 5 months ago by
Robert Marsden.
-
This topic was modified 10 years, 5 months ago by
Robert Marsden.
-
This topic was modified 10 years, 5 months ago by
Robert Marsden.

Stephen Harris
It’ll be possible to remove this (properly) in v1.11.0.
For now you can hide it via:
.booking-notice-prio-booking{ display:'none';}
or you can remove/change it via the eventorganiser_booking_form_notices hook, but this would involve using regex.
It’s also possible to add additional notices via that hook, however, you can’t “change it so it is specific to the date the user is trying to book”, because you don’t know which date the user is trying to book (yet). You could, though, list the previous dates booked.

Stephen Harris
It’ll be possible to remove this (properly) in v1.11.0.
For now you can hide it via:
.booking-notice-prio-booking{ display:'none';}
or you can remove/change it via the eventorganiser_booking_form_notices hook, but this would involve using regex.
It’s also possible to add additional notices via that hook, however, you can’t “change it so it is specific to the date the user is trying to book”, because you don’t know which date the user is trying to book (yet). You could, though, list the previous dates booked.

Rebecca Rumble
Just wondering if you got anywhere with this at all?
I’ve advised the client to avoid the admin calendar page and use the bookings page as it has the same information and is filterable.
but they are really keen to use the admin calendar rather than the booking page.

Stephen Harris
Hi Jan,
The sub-field labels are translatable. They are set in includes/form-customiser/class-eo-booking-form-element.php – they use the eventorganiserp (pro) translation domain.
I’ve checked this on v1.10.3 and it appears to be working.
In fact I found that the placeholder attribute was the one thing that was not translating because the domain was eventorganiser not eventorganiserp.

Jan Wildefeld
The “street-address” label in eo-booking-form-address.php dosn’t translate to its german values.
However it seems that only the placeholder is translateable via esc_attr_e but not <label> itself.
Could you provide us with a fix in the next version. It’s a minor bug, but pretty annoying in terms of pro-plugin.
It seeems that the label dosn’t translate in backend-view as well.
Thanks in advance
Jan

Alex Steer
Thanks Stephen that worked a treat!
I have taken it further for anyone interested – please feel free to tidy or amend.
function my_discount_tax_metabox_render( $booking ){
// Tickets
$tickets = eo_get_booking_tickets( $booking->ID );
if( $tickets ){
$ticketsum = 0;
foreach( $tickets as $ticket ){
printf(
'%s : %s (x%d)
',
esc_html( $ticket->ticket_name ),
eo_format_price( $ticket->ticket_price ),
intval( $ticket->ticket_quantity )
);
$ticketsum+= $ticket->ticket_price;
}
printf('<hr>');
echo 'Booking value: ' . eo_format_price( $ticketsum );
}
// VAT
$vat_amount = get_post_meta( $booking->ID, '_eo_booking_vat_amount', true );
$vat_rate = get_post_meta( $booking->ID, '_eo_booking_vat_percent', true );
printf( 'VAT (%s%%): %s
', intval( $vat_rate ), eo_format_price( floatval( $vat_amount ) ) );
// VAT Total
$vat_total = $ticketsum + $vat_amount;
printf('Subtotal: ' . eo_format_price( $vat_total ) . '
<hr>');
// Discount code
$discount = get_post_meta( $booking->ID, '_eo_booking_discount', true );
$code = isset( $discount['code'] ) ? $discount['code'] : false;
$amount = get_post_meta( $booking->ID, '_eo_booking_discount_amount', true );
printf( 'Discount code: %s
', esc_html( $code ) );
// Discount type amount
$distype = isset( $discount['code'] ) ? ' (' . $discount['discount_type'] : false;
$disamt = isset( $discount['code'] ) ? $discount['discount'] . ') ' : false;
printf( 'Discount:'. $distype . ' ' . $disamt .' - %s
<hr>', eo_format_price( floatval( $amount ) ) );
// Final amount
$total = eo_get_booking_meta( $booking->ID, 'booking_amount' );
printf('Final total: ' . eo_format_price( $total ) . '
');
}

Stephen Harris
Hi David,
You can use the form customiser ( Settings > Event Organiser > Booking Form) to re-order the form elements how they appear on the page.

Stephen Harris
You can display the tickets with:
$tickets = eo_get_booking_tickets( $booking->ID );
if( $tickets ){
foreach( $tickets as $ticket ){
printf(
'<p>%s : %s (x%d)</p>',
esc_html( $ticket->ticket_name ),
eo_format_price( $ticket->ticket_price ),
intval( $ticket->ticket_quantity )
);
}
and the total with
$total = eo_get_booking_meta( $booking->ID, 'booking_amount' );
echo eo_format_price( $total );

Stephen Harris
Hi Alex,
Yes, you’re right this should appear in the booking admin. In lieu of a more permanent solution (which will be subject to any potential reorganising of that screen) please us the following snippet which displays the VAT & discount code used on the booking admin page.
//Add metabox
add_action( 'admin_menu', function(){
add_meta_box( 'my-discounts-tax', 'Discounts and tax', 'my_discount_tax_metabox_render', 'event_page_bookings', 'side' );
});
//Render metabox contents
function my_discount_tax_metabox_render( $booking ){
//Discount
$discount = get_post_meta( $booking->ID, '_eo_booking_discount', true );
$code = isset( $discount['code'] ) ? $discount['code'] : false;
$amount = get_post_meta( $booking->ID, '_eo_booking_discount_amount', true );
printf( '<p>Discount code: %s</p>', esc_html( $code ) );
printf( '<p>Discount: %s</p>', eo_format_price( floatval( $amount ) ) );
//VAT
$vat_amount = get_post_meta( $booking->ID, '_eo_booking_vat_amount', true );
$vat_rate = get_post_meta( $booking->ID, '_eo_booking_vat_percent', true );
printf( '<p>VAT (%s%%): %s</p>', intval( $vat_rate ), eo_format_price( floatval( $vat_amount ) ) );
}
The fact the discount code doesn’t appear in the CSV is a bug which I’ll look into.

Frank Dandenell
I see your point. In my case I have a set of courses (appr 5) which occur at differents dates and locations during the year, but always the same price.
What I still need to solve is how to put a list for each course
with
date 1, location 1 and price.
date 2, location2 and price
I’ve managed OK to solve this by customizing the booking form and creating separate tckets for each location and pu this in the widget area.
But I would like to be able print out the price somehow, it’s ok if it’s only the price for the first ticket (since price are the same for all dates/locations)
/Frank

Alex Steer

Stephen Harris
Great, thanks! It seems that updating the ticket value triggers the display of the total (and correctly), so a simple fix is just to refresh the views once the models have been set up. I’ve checked the latest development branch and this problem doesn’t occur, so I’ll release a patch in the next day or so to fix this until the next minor release (1.11.0).
Re. pre-selecting gateways:
add_action( 'eventorganiser_get_event_booking_form', 'my_prefill_booking_form' );
function my_prefill_booking_form( $form ){
$gateway = $form->get_element( 'gateway' );
if( !$gateway->get_value() ){
$gateway->set_value( 'stripe' );
}
}

Frank Dandenell
Hi Stephen, I would like to show the event price on the event page, separate from the booking form. How can I do that, I looked for shortcode but couldn’t find any for the price.
Best regards, Frank