Getting Individual Ticket ID

Home Forums Ticket Products Event Tickets Plus Getting Individual Ticket ID

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #894004
    Joshua Hay
    Participant

    Hey guys,

    Sorry to bother you again but this is the last conundrum I have come across that needs to be solved for this project. I’ve gone through event ticket purchases in orders and accessed all item and order meta data that I’ve needed but still can’t figure out how to get the post or post ID for the individual tickets themselves.

    Is there an easy way to do this? Help would be very much appreciated, thanks.

    #894041
    George
    Participant

    Hey Joshua,

    I understand the frustrations you’re describing and am sorry you’re in that boat right now.

    Unfortunately, most of the best advice I could recommend here would be the same advice as what I recommended in your other, prior ticket about this issue → https://theeventscalendar.com/support/forums/topic/getting-event-from-ticket-id/

    The _product_id meta key mentioned in that issue should still be what you’re looking for, and if you’re doing things correctly, it should definitely be accessible. The limited support for customizations that I mentioned in the other ticket still applies, but I can recommend two steps that will make it easier for us to possibly recommend something more specific here:

    First, paste the whole file with your custom function into a Gist at http://gist.github.com – do not modify, or try to trim down, the file or code at all. Just paste all of what you’ve got into a Gist there.

    Then, go back to your code. If you’re still using this code, right between where you have $items = $order->get_items(); and $tickets = array();, add the following code:

    print_r( $items );
    
    die();

    This will break your site for a moment, but an array of $items should be printed on your page. Copy this entire output, and paste that into a separate Gist. You can then remove that print_r() debugging code.
    Let me know if you make both of these Gists – share the links for them, and we’ll take another brief look at your code here. Hopefully we can recommend something a bit more specific.

    Thanks,
    George

    #894077
    Joshua Hay
    Participant

    That’s not exactly what I’m looking for. That index returns the post ID for the ticket PRODUCT, not the TICKET itself. Each ticket has an ID generated for it which is displayed on ticket emails and I still can’t figure out how to reach it.

    Sorry if I mislead you, I just really need this unique identifier that the Admins can have displayed for them regarding purchase information.

    #897121
    George
    Participant

    Hey Joshua,

    Tickets themselves, within WooCommerce Tickets, are WooCommerce “products” – they should be generated as Products and visible if you go to the Products tab in your admin sidebar, right under the WooCommerce tab. If you find this list of products in your admin, you should see that tickets you’ve created for events are listed there, and added to the “Tickets” product category.

    The code I shared here and in your other ticket accesses the product IDs of these “products”, which are the Tickets themselves. The code does grab the ID numbers for the tickets themselves – just be aware that tickets themselves are Products at the same time.

    Let me know if this illuminates anything more about this issue – if it doesn’t, I’m very sorry for the continued misunderstanding of what you’re looking for. However, if what I recommended here is not working or doesn’t address what you’re trying to get at at all, please try elaborating on your goals in much, much more detail. Use screenshots where you can, for example.

    #949939
    George
    Participant

    Hello,

    This issue’s been sitting here a while so I’m going to go ahead and close it for now – if other issues arise, don’t hesitate to come back and open a new ticket, and if you need to open a new ticket about the same issues you originally brought up here, please share a link to this original ticket so we can pick up where we left off.

    Cheers!
    George

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Getting Individual Ticket ID’ is closed to new replies.