Posted: June 8, 2017 at 8:39 pm
|
Hi there, I had a quick question. Tony kindly (and patiently) helped me with visibility of tickets for member/non-member based on capability using this function functions3.php https://gist.github.com/Pebblo/16a7dabb6a6d8f0f3d4370ccda06098b#file-functions3-php However i’ve discovered that not on every occasion will there be a non-member price AND member price scenario. In some cases there will be “accessible to all” tickets. The code i’m using (from the snippet) is set to assume a member and non-member ticket. In other words, if there are ticket(s) that don’t have the capability set on the ticket it’s hidden. That’s cool for all situations, except a ticket-for-all scenario. Is there a way to change the code to allow and all users scenario? Many thanks |
Sounds like with the ‘ticket-for-all’ scenario you need to disable the above snippet completely so that whatever tickets are set on the event will show up. If you then don’t have access to the ticket based on capabilities it would show the default message but if no cap was set it would display the ticket, is that what you are looking for? |
|
|
Hi Tony, In 90% of cases the scenario of member/non-member tickets and visibility (and hidden) tickets would as the snippet intends. On the odd occasions where there is just a single ticket for all, it would be great to allow for that scenario. Not sure if it’s possible with a code extension? At the moment we are having to create 2 tickets at the same price, because a member would see no tickets if there is no capability put on the ticket. Does that make sense? Matt |
I’d do that with an event meta value like so:
Add that above Line 9 of the gist you are using. Then on the events that you don’t want the code from the gist to run on add a meta value of ‘skip_hide_tickets’ – http://take.ms/hgdJe (You can use ACF or similar to make a checkbox if preferred. |
|
|
Thanks Tony, Unfortunately it’s still not showing any ticket options as a member, with the above code and adding a custom meta to the event. I’ve added the code, added the custom meta, removed the capability requirement. That’s correct, right? Cheers |
I have no idea without seeing the code ๐ Can you create a gist of the code you have, and take a screenshot of the event meta you added to the event? |
|
|
Hi Tony, This is the code i’m using
The custom field is as you have it on your screen grab. Nothing added to the capabilities required field on the ticket itself. Thanks for taking a look. |
Yeah, I see, I made a silly mistake. This line:
needs to be:
It should work then. |
|
|
Thanks Tony. Works now : ) Appreciate your time again. |
You’re most welcome ๐ |
|
The support post ‘Multiple Ticket and Pricing Options – capability based filter (follow up)’ 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.