Posted: May 9, 2018 at 8:45 am
|
Hello, Before installing the user integration for our members program, I would select “This ticket is required” for every event to make sure 1 ticket is selected by default for all users. Now that we are launching members program where paying members will get 15% discount on all the trainings, I started to add a second ticket with members only capability and a 15% discount to all the existing trainings. The problem is that the checkout page still shows normal ticket selected and set as 1 even for the members. I know that I can deselect ticket is required, but then all normal customers would have to select 1 normal ticket manually during checkout (and most of them will surely not realize it). Ideally, I would like to: For non-members: Show normal ticket selected and set to 1, but still show the members ticket with discount (although not selectable). For logged in members: Members ticket selected and set 1 one, no need to show the normal ticket (or still show it but set to zero). Could you let me know how to do this? |
Ok, so will the member ticket always be a replacement for the ticket without a capability set on it? Will logged in users always have access to the member tickets or can they be logged in an not have access to specific member tickets? I’m asking because you set both tickets to be required and then use this snippet: https://gist.github.com/Pebblo/16a7dabb6a6d8f0f3d4370ccda06098b#file-functions2-php Which removes tickets that do not have a capability set on them from view when you are logged in (and not an administrator). So if you have 2 tickets, one without a capability (we’ll callit ‘No cap ticket’) set and another with a capability set (we’ll call that ‘Cap ticket’) logged out users see both tickets, ‘No cap ticket’ will be required, Cap ticket will show the ‘no access’ message (doesn’t matter that its required when you can’t access it). Logged in users will only see the ‘Cap ticket’ as it has a capability set. The snippet skips this functionality within the admin AND also shows ALL tickets if the user account has the ‘manage_options’ capability (meaning they are an administrator). Is that what you are looking for? |
|
|
Important distinction here is the members are not all logged in users. The members are logged in users who bought membership => they have um_member capability set by ultimate members plugin. So yes, for these members, the members only ticket with 15% discount will always be a replacement vs normal ticket.
That’s a mistake, both tickets should not be required obviously
Correct. ‘No cap ticket’ with the no access message should show for both logged out users and for logged in users without ‘um-member’ capability.
Correct. They could also see the no cap ticket (to understand that they’re getting the discounted ticket), but it should be greyed out. Another solution would be to show them just one ticket, but the original price crossed out and showing the 15% discounted price.
yes you’re right. I guess for the admin it can show both selected as zero tickets, so that we can do quick tests. |
So you have both logged in users that can not purchase the ‘discount’ ticket and logged in users that can? If so the snippet won’t work for you.
Why is it a mistake? |
|
|
Exactly, I followed your guidance to create a membership site and I assign the ‘um-member’ capability for those who purchase membership. There will still be lots of users who are logged in and can see their past registrations etc, but they will not have access to member prices and activities until they purchase the membership and get assigned the ‘um-member’ capability.
For a training, one person should only need one ticket, not two. Either the normal ticket, or if the user is a member, then the discounted member ticket. |
If they can only access either one of those tickets at a time and you want to make sure they purchase 1 of that ticket then when using the snippet I linked to, you would need both of the ticket set to required, so it wasn’t a mistake. But…
This changes things. So what is the capability set on the ticket? Is it You’d want these logged in users that are not members to be able to access the ‘non-discount’ ticket? |
|
|
Indeed it’s
yes sure, logged in users do not have any special treatment vs non logged in users. |
|
The discounted tickets and the members only events should be accessible only to users with |
In that case, try this function: https://gist.github.com/Pebblo/16a7dabb6a6d8f0f3d4370ccda06098b#file-functions3-php Change line 12 to:
Meaning if the ticket capability is empty, the user is logged, not an administrator and that do NOT have If that doesn’t work for you’ll need a developer to create a function that works for your specific needs. |
|
|
Hey Tony, This worked:) Thank you for the amazing support, I know my questions are mostly outside the scope of the promised functionalities of the plugin, but you still helped me perfectly. |
|
Sorry, one more question:) |
The support post ‘Members only 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.