Is it possible to get the attendees names for an event via a ticket?

Home Forums Ticket Products Event Tickets Plus Is it possible to get the attendees names for an event via a ticket?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #247679
    Mohammad Zubair
    Participant

    Hi,

    I am making use of The Events Calendar 3.6.1 and WooTickets 3.6.
    I have my own template override of the tickets.php page. I’m trying to know if a user has already bought the ticket listed on the page, by checking if he or she is in the attendee list. If so, the ticket will not be shown. In ticket.php I saw that the ticket id is available, and a WooCommerce product reference is fetched. Is it possible to get the linked event from this type of ‘product’ and then get the list of attendees? If so, what would be the code for this. If not, are there any alternatives?

    I hope to hear from you soon.

    #250076
    Barry
    Member

    Hi – interesting idea!

    Assuming the user is logged in with the same account they used to make the purchase, or you can otherwise reliably identify them – then yes, that should be possible.

    It is very much a custom development question, though, and really one that pertains more to WooCommerce than WooCommerce tickets itself: but, if you have a reference to the product, you should be able to obtain orders relating to the customer and inspect their previous purchases to see if there are any matches.

    There are some great tutorials on working with WooCommerce out there and of course they also have their own Codex (and, last but by no means least, you could approach the Woo team for further assistance on this one if needed).

    Thanks again – and good luck with the project 🙂

     

    #250244
    Mohammad Zubair
    Participant

    Hi Barry,

    Firstly, thanks for your quick reply.
    Yes, the user will be logged in and is the user that bought the ticket. I was assuming that maybe some WooTicket specific metadata or metakeys were used, for that reason I asked the question here. Thank you for pointing me in the right direction. I’ll do some debugging first, and search in the WooCommerce area. Thumbs up for The Events Calendar and WooTickets 😀

    #250358
    Barry
    Member

    Definitely and you’re right – there are a set of relationships that are mapped out through post meta data – but if you’ve already got a reference to the product itself you should be good to concentrate on the WooCommerce side of things.

    Just in case though, the basic scheme we use is:

    • Products have a piece of meta data named _tribe_wooticket_for_event linking them to the event post
    • Once tickets are purchased ticket posts are generated and these are linked to the order via the _tribe_wooticket_order key

    I hope that helps – and good luck with the project 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Is it possible to get the attendees names for an event via a ticket?’ is closed to new replies.