Home › Forums › Ticket Products › Event Tickets Plus › Limiting Ticket Display Based on User Meta
- This topic has 3 replies, 2 voices, and was last updated 10 years, 4 months ago by Kelly.
-
AuthorPosts
-
January 3, 2014 at 10:47 am #86279QuentinParticipant
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.January 3, 2014 at 2:39 pm #86376KellyParticipantGreat 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. 🙂
January 6, 2014 at 10:04 am #87422QuentinParticipantYeah, 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.
January 6, 2014 at 1:33 pm #87535KellyParticipantHi, 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!
-
AuthorPosts
- The topic ‘Limiting Ticket Display Based on User Meta’ is closed to new replies.