Hi Stephen,
I am using your plugin for a community run events calendar, many organizers need to log on and create events. I am wondering if I could make it easier for them to create events. Especially adding tickets which for us are really only spots to an event. I would like to only have one ticket per event and have the price and spot selector as a default view instead of the add ticket table. Also found the file responsible, which is event-organiser-pro/admin/edit.php however I was wondering if you had a simple way to accomplish what I wanted to do? Also I was not able to override this file in my child theme. Any leads on that?
Thank you very much,
Florian
accwebmaster
I would also be happy to accomplish this with the FES addon.
Please let me know if you have any ideas.
Thank you!
accwebmaster
Hi Florian,
With the FES add-on, when an event is created the following hook is triggered: eventorganiser_fes_submitted_event
. You can use that to create the event’s tickets
Untested, but should work:
add_action('eventorganiser_fes_submitted_event', function($event_id, $event, $form) {
$dates = eo_get_the_occurrences($event_id);
$occurrence_ids = array_keys($dates);
eventorganiser_insert_ticket( $this->event_id, array(
'name' => 'Ticket A',
'price' => 3.25,
'spaces' => 5,
'occurrence_ids' => $occurrence_ids, //required for recurring events, if booking by date
'order' => 1,
) );
}, 10, 3);
Stephen Harris
Thank you Stephen,
I think I was not clear, I would like like to make sure that only one ticket type exists per event and that the event organizer only selects how many spots there are for the event. I found users are hitting “add ticket” 15 times instead of having one ticket type with 15 spots.
Would you have any idea for this?
Best,
Florian
accwebmaster
Hi Florian,
Ok, that’s not a straightforward task, but it is possible.
You would need to remove the existing ticket metabox, and replace it with your own which would just have the one field: the number of spaces. You would then need to hook into the event update, and then use the eventorganiser_insert_ticket
/ eventorganiser_update_ticket
to create/update the ticket with the appropriate number of spaces (hard-coding all other values, such as the name, price etc unless these should also be configurable).
Stephen Harris
Thank you Stephen,
basically this is what i want to accomplish:
Could you point me to where I would be able to change the ticket metabox? It isn’t in any template I can override no?
Thank you, Florian
accwebmaster
Hi again Stephen,
do you have any input about this?
Struggling to archive this without overwriting the plugin’s code.
Any way you could get in contact directly? I have a couple of issues that are preventing me from going live with our new website.
Best,
Florian.
accwebmaster
Hi Florian,
No the metabox isn’t templatable.
I’ll be in touch via email..
Stephen Harris
Hi Stephen,
thank you for replying. I am wondering if you receive my emails?
Best,
Florian
accwebmaster
Hi Florian,
Just replied to your email.
Stephen Harris