Posted: July 31, 2023 at 9:09 am
We have are in the process of setting up EE for one of our clients. I have installed the WP User integration add on along with EE.For non-logged-in users, I want to display the tickets with visibility set to <b>Public</b> else show a custom message asking them to login to buy the ticket. Please share the hook/filter/setting to do this. Thanks |
|
Hi there, That sounds like the default setup. Any tickets set to be Public, show to all users. Any ticket set to be members only require the user to be logged in to be visible and will display a message stating that. To set the visibility of a ticket you edit the ticket: https://monosnap.com/file/CJ3EpeiaJZQFVgp2ceOiaSp84hRkBi Then check the visibility options: https://monosnap.com/file/ypkJFNs9KMLKBmhbDrXxeN31U7KtEx You can also set a custom capability on the ticket in the section below that if needed. Setting a custom message for EE to use can be done via a filter:
A quick example can be found here: https://gist.github.com/Pebblo/783dc4f9f43b9780d860112817edfd6d |
|
Thank you for quick answer.I implemented the filter as shown in the eample FHEE__EED_WP_Users_Ticket_Selector__maybe_restrict_ticket_option_by_cap__no_access_msg and this gets executed only for WP Users who are logged in. But I need to show custom message if <b>there is a member only ticket but no public tickets.</b>. Please let me know how to do this. Thanks |
|
That filter should fire for both logged-in and logged-out users. Logged-in users without the capability… don’t have access to the ticket, so show that message. Logged-out users don’t have capabilities so instantly don’t have access and should show that message. Which version of EE and the WP user integration add-on are you running, I’ll double check. |
|
Logged-in users without the capability… don’t have access to the ticket, so show that message.This is working Logged-out users don’t have capabilities so instantly don’t have access and should show that message. This is not working Event Espresso version: 5.0.7.p and Event Espresso – WordPress Users Integration version: 2.1.1.p Thanks |
|
Oh! I see the problem. When you set a ticket to be Member only, it is only visible to members, aka logged-in users. So yes, logged-out users won’t see the ticket at all. Set the ticket to be publicly visible but then in the WP Users -> Ticket Capability Requirements option to be either Read capabilities (for just checking for a logged in user), or a custom capability (if you want to check for a specific cap). |
|
Thanks Tony. Modified the settings and now it is working. |
|
We don’t have full docs for the new editor yes but the way the capability check works hasn’t changed since the original version which can be found here: https://eventespresso.com/wiki/wp-user-integration/#ee4usage The ‘visibility’ option is new but that basically just allows you to set the basis on who can view the ticket before the capability check is done. |
|
The support post ‘How to toggle between no tickets available message and tickets’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.