Limiting Ticket Display Based on User Meta

Home Forums Ticket Products Event Tickets Plus Limiting Ticket Display Based on User Meta

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #86279
    Quentin
    Participant

    Is it possible to hide/display certain available tickets based on the current user’s role or other meta information?

    Example:
    We have training events that require registration, but we have some people who have completed some amount of training previously, and these people are able to ‘audit’ the trainings for a lower cost. This is only available to these people though, so we would like to show the “standard” ticket for everyone, and hide the “audit” tickets for everyone unless they are of a certain role or user group.

    #86376
    Kelly
    Participant

    Great question, egojab! This is totally possible, but to do exactly as you describe would be something that would require some custom development based on exactly how you want it to behave.

    You could definitely create something where you look at the user details with wp_get_current_user() and then act based on what you find there. That would be outside the scope of what I could help you with in this forum, though.

    Another option would be to give out discount codes (generic or user-specific) that would allow users to buy a ticket at a discounted price, using the existing functionality in WooCommerce.

    If you do decide to go with coding something to make this work, please let us know if you come up against any snags. We’re always here to help make sure you’re pointed in the right direction. 🙂

    #87422
    Quentin
    Participant

    Yeah, I know how to get the appropriate user information from WordPress itself, I guess my bigger question may be more whether or not it was something that could be easily configured to add through the backend portion; for instance, adding a checkbox or dropdown to the ticket creation step. I know that I can just inject a couple of checks into the front end template in my theme to just not display them based on something like the ticket SKU, and just make sure that all tickets are set up with the same SKU or a substring of the SKU. Are there any existing hooks or anything to be able to add additional fields to the tickets themselves? I did peruse the documentation some, but didn’t see much documented for actions/hooks.

    #87535
    Kelly
    Participant

    Hi, Quentin! That’s great that you feel comfortable digging into all of this.

    The WooCommerce Tickets UI that you see in the event editor is itself injected using the tribe_events_tickets_metabox_advanced action and you could also use that same action. I’m afraid there are not any more specific hooks at this time, but if you find you run into difficulties, we’d certainly welcome any feature request you might make along these lines. (If so, feel free to post away over on https://tribe.uservoice.com/.)

    I hope that helps!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Limiting Ticket Display Based on User Meta’ is closed to new replies.