Determine if product is ticket

Home Forums Ticket Products Event Tickets Plus Determine if product is ticket

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1106905
    Niels
    Participant

    Hey guys,
    I’m currently setting up my Ticket Plus with Woocommerce and want to know if you can give me a nudge in the right direction.
    Is there a built in function to determine if a WC-product is a ticket set up by ECTP and ideally return the event id?
    I want to set up some conditions to discount certain ticket combinations but only if they are from the same event.

    Thanks a lot
    Niels

    #1106973
    Brook
    Participant

    Howdy Neils,

    Absolutely there is! CheckoutĀ tribe_events_get_ticket_event( $ticketid ) . Just pass the ticket ID to that function. If the return === false, there is no event associated with the product. Otherwise the return will be an integer, namely the event’s ID.

    You might also be interested inĀ tribe_events_product_is_ticket() . But it sounds like you won’t need that here.

    Does that all make sense? Will that work for you? Please let me know.

    Cheers!

    – Brook

    #1106994
    Niels
    Participant

    Sweet!

    This looks exactly like what I was looking for – thanks!
    I’ll give it a shot asap.
    I shall report…

    Best
    Niels

    #1107076
    Brook
    Participant

    Perfect! I will await your response. Thanks for getting back.

    • Brook
    #1107589
    Niels
    Participant

    Works flawlessly…
    Thanks a lot for pointing to it.

    Best
    Niels

    #1107703
    Brook
    Participant

    Excellent news! It was my pleasure.

    • Brook
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Determine if product is ticket’ is closed to new replies.