Home › Forums › Ticket Products › Event Tickets Plus › Determine Ticket Type
- This topic has 7 replies, 2 voices, and was last updated 10 years, 2 months ago by
Josh.
-
AuthorPosts
-
February 1, 2016 at 5:13 am #1065489
Dan Feeley
ParticipantIs there an easy way (from within the Events Calendar single event template) to determine if the ticket(s) attached are either WooCommerce or RSVP and retrieve their ticket ID(s)?
February 1, 2016 at 9:31 pm #1066091Josh
ParticipantHey Dan,
Thanks for reaching out to us!
You should be able to get the information the way that you’d like. Would you mind giving a little more detail about what you’re trying to accomplish? I’d like to get you pointed in the right direction with a snippet but this could go a couple of different directions depending on the use.
Thanks!
February 3, 2016 at 5:07 am #1066760Dan Feeley
ParticipantWe use an image overlay on each event to show whether that event is soldout or only has a few remaining tickets left. And since 4.x I can’t get them to stop removing people from the attendee list that are no longer attending. When they do that there’s a mismatch in the stock count which causes an discrepancy with the overlay.
I’ve been following this thread which may help but I will still have a problem if they delete someone. My basic goal is to determine what type of ticket is attached and if it is a wooticket to take the inventory from woocommerce and if it is a RSVP to use tribe_events_has_soldout().
Hope that makes sense…
February 4, 2016 at 2:19 pm #1067890Josh
ParticipantHey Dan,
Thanks for following up and providing the additional information.
You can use:
Tribe__Tickets__Tickets::get_all_event_tickets( $event->ID );to get the tickets associated with the event. You could then test the post_type for that ticket to see if it is a WooCommerce product or you could check the meta for that product to see if it contains a “_tribe_wooticket_for_event” meta value.
Let me know if this helps.
Thanks!
February 5, 2016 at 7:28 am #1068258Dan Feeley
ParticipantI think this will do perfectly, thank you.
February 9, 2016 at 7:04 am #1070261Josh
ParticipantHey Dan,
No problem! I’ll leave this ticket open in case there are further questions/issues when looking into this approach.
Thanks!
February 11, 2016 at 4:24 am #1071237Dan Feeley
ParticipantI think it’s safe to close it. I was able to successfully get everything I needed out of it (and some).
Thanks again.February 11, 2016 at 10:03 pm #1071832Josh
ParticipantHey Dan,
Awesome!
I’ll go ahead and close this thread for now. If you have any further questions, please don’t hesitate to open a new one.
Thanks!
-
AuthorPosts
- The topic ‘Determine Ticket Type’ is closed to new replies.
