WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
Prevent Booking more than one event at the same time (10 posts)

  1. seannittner
    Member
    Posted 3 years ago #

    I've just started using Event Manager and it looks nearly perfect, but there is one major hang up that I haven't figured out how to get around.

    I've got several events and I found that users can book themselves in multiple events happening at the same time. This is bad.

    Is there any way for the booking to check and show an message similar to "You're already booked for this event" but instead "You're already booked for an event during this time"?

    Thanks so much for any direction on how to do this,

    Sean

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    You'd have to use some php, but it's possible. I can give you some general guidance if you can code.

  3. seannittner
    Member
    Posted 3 years ago #

    Hi Marcus,

    Pointing me where to start would be great. My PHP skills a little rusty, but in my head I think it's going to look at little like this:

    $[gametime] = "SELECT [gametime] FROM [tablename] WHERE [userid] = $userid"

    foreach ($[gametime] as $value) {
    if ($value == $[newgameselection]) {
    echo "You are already in a game or event at this time slot. Please choose another game or event."

    I'm just not sure the specific of what I'll be looking at yet or where I should be putting this.

    Thanks,

    Sean

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    hook into the em_booking_add and if you use this:

    $EM_Person = new EM_Person($user_id);
    $bookings = $EM_Person->get_bookings();
    count($bookings) = x;

    output JSON accordingly and exit if needed

    see em-actions line 249 for more info

  5. seannittner
    Member
    Posted 3 years ago #

    Thanks Marcus, I'll give that a shot tonight.

  6. seannittner
    Member
    Posted 3 years ago #

    Hi Marcus,

    I'm digging up this old thread because I hired a developer to implement the changes you suggested. He's done it and the fix works wonderfully, preventing users from booking two events at the same time.

    Can I send you the code he wrote? Seeing as the work is already done, I think this could make a cool addition to the plugin.

    Sean

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    sure, i'd certainly have a look at including it, if you could reach us via our plugin page contact form, link here, we'll get in touch.

  8. leiapeja
    Member
    Posted 2 years ago #

    Hi,

    I am trying to enable users to book several events, with the same email, without login, does anyone know how to do that? just get a message that says login, but i want it to go through without login.
    Thanks!

  9. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    Enable guest bookings, and there's an option to allow double bookings in the booking and ticketing options in settings.

  10. robertodimarco
    Member
    Posted 2 years ago #

    Hi seannittner, have you resolved your problem? I've the same problem too, can you help me? Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic