Standard single ticket on event

This topic contains 9 replies, has 2 voices, and was last updated by  Stephen Harris 4 years, 8 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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

    accwebmaster
    #37003

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

    Thank you!

    accwebmaster
    #37114

    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
    #37176

    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
    #37239

    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
    #37378

    Thank you Stephen,

    basically this is what i want to accomplish:
    SCREENSHOT

    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
    #37672

    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
    #37681

    Hi Florian,

    No the metabox isn’t templatable.

    I’ll be in touch via email..

    Stephen Harris
    #37767

    Hi Stephen,

    thank you for replying. I am wondering if you receive my emails?

    Best,
    Florian

    accwebmaster
    #37784

    Hi Florian,
    Just replied to your email.

    Stephen Harris
Viewing 10 posts - 1 through 10 (of 10 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.