New ticket functionality?

Home Forums Ticket Products New ticket functionality?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1082497
    John
    Participant

    Hi there,

    I’ve just upgraded many plugins (as listed below), and I have a question about whether or not ticket functionality has changed.

    BEFORE:
    The Events Calendar v3.9.1
    The Events Calendar PRO v3.9.1
    Event Rocket v2.5
    Woocommerce v2.3.5
    WooCommerce Authorize.NET AIM Gateway v3.4.2
    The Events Calendar: WooCommerce Tickets v3.9.2

    AFTER:
    The Events Calendar v4.0.6
    The Events Calendar PRO v4.0.6
    Event Rocket v2.5
    WooCommerce v2.3.5
    WooCommerce Authorize.NET AIM Gateway v3.4.2
    Event Tickets v4.0.5
    Event Tickets Plus v4.0.5

    Now, in the old implementation of The Events Calendar PRO and WooCommerce Tickets, tickets for a recurrence series were shared. For example, let’s say I want to offer a private tutoring lesson once a day for seven days. Now, logically, I should create an event that occurs once a day for 7 days, and then add one ticket for the series with a stock of 1, so that when someone signs up for one day, nobody else can sign up for that day as well. However, if I remember correctly, the default functionality made it so that the tickets for a series were shared. i.e. when Jim signs up for Monday by purchasing that day’s ticket, the tickets are no longer available for anyone else for any other day. Jim has effectively reserved his spot for the entire recurrence series.

    Now, this was a problem for my website because we offer different levels of classes, and if there is a recurrence series, it’s the same class being taught multiple times. i.e. “Beginner’s class” happens once a week, and nobody should want to attend the Beginner’s class more than once. My workaround was to modify the plugin by hand so that when a recurrence series was created, tickets were created for each instance of that series, not just for the parent event.

    Is this still the case? Will I need to modify the plugin by hand again in order to get a unique stock of tickets for each recurrence instance? Or does each recurrence instance already have a unique stock for that ticket? If I do need to modify the plugin to duplicate the “parent” ticket for each recurrence instance, do you know what document of the plugin I’d need to do that in?

    Additionally, I need to be able to set a dynamic “Sale End Date” for the tickets. Instructors for a class want to be able to estimate the class size before the class actually begins, so we don’t want to be able to sell tickets past midnight the night before the event. In earlier implementations, when you select a “Sale End Date” for a ticket, that means that that date is static. Going back to my private tutoring lessons example, let’s say that Jim wants to attend on Monday, but I don’t want my ticket to be available past 11:59 PM Sunday, so I make my Ticket Sale End Date 11:59 PM Sunday. When Monday comes, and someone wants to sign up for Tuesday’s private lesson, they can’t see the ticket, because that Sale End Date means that tickets aren’t available for ANY instance after the sale end date passes. This was another issue for us that we had to fix by hand – is this still the case? If so, do you know where I would need to make modifications?

    Lastly, I need to be able to add the date of an event to the end of a ticket’s name. Authorize.NET doesn’t differ between two tickets for different class dates in the report we run, so we had to work around that by making each unique ticket for each recurrence instance have that instance’s date appended to it at the end. Do you know the document where tickets are saved in? If so, I could just add a line or two to modify the name of the ticket when it’s being saved as a post so it has the event’s date appended to the end of it.

    Thank you for taking the time to read this, and I hope you’re able to help me!

    #1082642
    Geoff
    Member

    Howdy John,

    First off, awesome job making the updates from 3.x to 4! That’s no small deal and I’m stoked to see you running the latest versions. 🙂

    That said, you can remove the Event Rocket plugin. The plugin author is no longer maintaining it and it is sure to create conflicts down the road.

    Is this still the case? Will I need to modify the plugin by hand again in order to get a unique stock of tickets for each recurrence instance?

    This is indeed still the case. However, I am very happy to report that we are working on this feature as we speak and plan to have it included in Event Tickets and Event Tickets Plus 4.1. It’s coming!

    Additionally, I need to be able to set a dynamic “Sale End Date” for the tickets.

    The closest that Event Ticket Plus gets to dynamic dates is exactly the process you detailed. You can can either create different tickets that start and end sale on specific days and times, or edit the existing tickets manually when wanting to change dates. In other words, this hasn’t changed from WooCommerce Tickets to Event Tickets Plus.

    Lastly, I need to be able to add the date of an event to the end of a ticket’s name.

    Intersting! Tickets are actually stored in WooCommerce as a Products. So, you would need to call the WooCommerce function that returns the ticket name, then use the calendar’s tribe_get_start_date() function to append the date of the event to the name. I would imagine this occurs in multiple places within WooCommerce (from the front-end display to the cart) and would need to be altered in those places.

    Does this help answer your questions? Let me know if there’s anything I can clarify or expand on and I’d be happy to as best I can!

    Geoff

    #1084870
    John
    Participant

    Hi Geoff,

    That did answer most of my questions, and I’ve since written all of the code to resolve those issues, HOWEVER, I am having difficulty getting the ticket objects with all their postmeta data stored on them in my duplicate_tickets() function. I’ve created that function in the Tribe__Events__Pro_Recurrence_Instance class since my function should be called each time a recurrence instance has been created, that way, each event will have its own stock of however many tickets necessary.

    What I’m trying to do is run this call

    $tickets = Tribe__Tickets_Plus__Commerce__WooCommerce__Main::get_tickets($this->parent_id);

    The get_tickets() function should return the ticket object(s) in the form of an array containing individual ticket objects. However, because I’m accessing Tribe__Tickets_Plus__Commerce__WooCommerce__Main from Tribe__Events__Pro_Recurrence_Instance, I’m getting an error saying I can’t make a call from a non-static method duplicate_ticket() to a static function get_tickets(). Is there another function I can use to get the ticket objects (not an array of ticket IDs)? Like, a designated tribe_get_tickets(); or something? Or am I going to have to copy the code of get_tickets(), get_ticket(), and get_ticket_ids() all out of Tribe__Tickets_Plus__Commerce__WooCommerce__Main and into my duplicate_tickets() function so I can have access to that functionality within Tribe__Events__Pro_Recurrence_Instance’s scope?

    #1085181
    Geoff
    Member

    Hi John,

    When looping through tickets on a specific event, I typically add something like this to the loop:

    $ticket_product_id = get_post_meta( $ticket['ticket_id'], '_tribe_wooticket_product', true );
    $ticket_product = get_post( $ticket_product_id );

    Geoff

    #1091383
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘New ticket functionality?’ is closed to new replies.