John

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: New ticket functionality? #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?

    John
    Participant

    Hi Geoff,

    Strangely enough, it seems like it’s only that recurrence instance that is broken. I pretty distinctly remember using that event as my test case at some point, so I don’t know why it suddenly doesn’t work, but when I made a new test case in my 4.0.1 environment, then transferred the database containing that test case to my 4.4.2 environment, the ticket performed as expected. I’m not sure why this may have been the case, and that means that the broken event is still a broken event, but I’m not too torn up about that because it’s broken on both 4.0.1 and 4.4.2, so it must not have been working for quite some time, contrary to my memory.

    Thanks for your help all the same! I appreciate your time, and I’m sorry I couldn’t offer a more comprehensive response – I don’t really understand why that event would be behaving that way, but I’m certainly not complaining if it’s an isolated incident. 🙂

    in reply to: Custom Fields for Tickets #966666
    John
    Participant

    Thanks for your quick response, Geoff!

    I understand these tips for the most part, but what I don’t get is how to edit the product metadata of the tickets. I want to do this right, so I’m interested in taking that route, but I’m not sure how to go about it. If I wanted this to be a property of each individual ticket that can be changed on an individual basis in the back-end (preferably in the same spot that we define the time that the ticket will be available), how could I add that additional ticket-specific data? Is there a tutorial I could take a look at? I don’t really understand how to manipulate the tickets as products because every tutorial I’ve seen has been using an interface that my site doesn’t have, so I’m really confused.

    I really appreciate your patience and cooperation, Geoff! 🙂

    in reply to: Custom Fields for Tickets #966621
    John
    Participant

    Thank you for your help, Geoff! Your suggestions have helped me a great deal so far, but out of curiosity, are the tickets being saved in any specific way? I’m looking at the meta-box.php document in the-events-calendar/admin-views/tickets/ and I know that this is the spot where I want to add one or more inputs, but I’m not sure how to get the ticket to recognize it as a property so it can be exported as an attribute (column) during CSV export. If I just add an input with an id and name of “cost_center” and a class of “ticket_field”, would the plugin recognize that and add it as a new column on tickets from now on? Or would I need to add some code elsewhere?

    Thank you for your help! I understand that it obviously isn’t exactly preferable to go mucking about in the core files and modifying the functionality of the plugin at its core, but this is a function I needed very badly, and your help in getting me to the end of this is greatly appreciated. 🙂

Viewing 4 posts - 1 through 4 (of 4 total)