How to make Tickets mandatory field while submitting event

Home Forums Ticket Products Event Tickets Plus How to make Tickets mandatory field while submitting event

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1213014
    Tac
    Participant

    Hi,

    We are using Community Events and Community Tickets on our website enabling, event organisers to submit and manage their events themselves.

    At this stage, only Event Title and Event Description is mandatory and event organiser most of the times overlook ticketing information and Submit the events. We then have to contact them and educate them on how to add tickets or we have to create tickets for them. This has cost us losing many events.

    Can you please advise us a way to make Tickets related fields such as Ticket Name, Price etc mandatory while submitting the event?

    Thanks.

    #1213441
    Nico
    Member

    Hi there Tac,

    Thanks for reaching out to us! I can help you on this 🙂

    Can you please let me know which type of tickets you want to make mandatory? RSVP? Woo?

    Please let me know about it,
    Best,
    Nico

    #1213444
    Tac
    Participant

    Thanks Nico.

    Ideally, both RSVP and Woocommerce need to be mandatory but at this stage we are only using Woocommerce, so that would be great if we can get it sorted.

    Thanks.

    #1214467
    Nico
    Member

    Hey Tac,

    Thanks for following up! Add the following snippet to your theme’s (or child theme’s) functions.php file and it will validate that there’s at least one ticket added to the event. It doesn’t check which type of ticket, so it will work for RSVP and/or WooCommerce tickets 😉


    /* Tribe, make sure the event has at least a ticket added */
    add_filter( 'tribe_community_events_validate_submission', 'tribe_ce_validate_tickets', 10, 3 );

    function tribe_ce_validate_tickets ( $valid, $submission, $handler ) {

    if ( !tribe_events_has_tickets ( $submission['ID'] ) ) {
    $handler->add_message( 'Please add at least one ticket to the event', 'error' );
    $valid = false;
    }

    return $valid;
    }

    Please let me know if it works for you,
    Best,
    Nico

    #1225615
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to make Tickets mandatory field while submitting event’ is closed to new replies.