Standard single ticket on event

This topic contains 5 replies, has 2 voices, and was last updated by  Florian Geier 6 days, 12 hours ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #36906

    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 Geier

    I would also be happy to accomplish this with the FES addon.
    Please let me know if you have any ideas.

    Thank you!

    Florian Geier

    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?


    Florian Geier

    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

    Florian Geier
Viewing 6 posts - 1 through 6 (of 6 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.