Support

Home Forums Event Espresso Premium Members only tickets

Members only tickets

Posted: May 9, 2018 at 8:45 am


Oguzhan Altun

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?


Tony

  • Support Staff

May 9, 2018 at 3:30 pm

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?


Oguzhan Altun

May 10, 2018 at 2:36 am

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?

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.

I’m asking because you set both tickets to be required and then use this snippet:

That’s a mistake, both tickets should not be required obviously

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).

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.

Logged in users will only see the ‘Cap ticket’ as it has a capability set.

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.

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).

yes you’re right. I guess for the admin it can show both selected as zero tickets, so that we can do quick tests.


Tony

  • Support Staff

May 10, 2018 at 3:43 am

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 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.

That’s a mistake, both tickets should not be required obviously

Why is it a mistake?


Oguzhan Altun

May 10, 2018 at 4:28 am

So you have both logged in users that can not purchase the ‘discount’ ticket and logged in users that can?

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.

Why is it a mistake?

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.


Tony

  • Support Staff

May 10, 2018 at 4:58 am

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…

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.

This changes things.

So what is the capability set on the ticket? Is it um-member or something else?

You’d want these logged in users that are not members to be able to access the ‘non-discount’ ticket?


Oguzhan Altun

May 10, 2018 at 2:42 pm

So what is the capability set on the ticket? Is it um-member or something else?

Indeed it’s um-member. When they purchase a subscription, the Ultimate Member plugin assigns them the um-member capability.

You’d want these logged in users that are not members to be able to access the ‘non-discount’ ticket?

yes sure, logged in users do not have any special treatment vs non logged in users.


Oguzhan Altun

May 10, 2018 at 2:43 pm

The discounted tickets and the members only events should be accessible only to users with um-member capabilities.


Tony

  • Support Staff

May 15, 2018 at 1:44 am

In that case, try this function:

https://gist.github.com/Pebblo/16a7dabb6a6d8f0f3d4370ccda06098b#file-functions3-php

Change line 12 to:

if( ! current_user_can( 'um-member' ) ){

Meaning if the ticket capability is empty, the user is logged, not an administrator and that do NOT have um-member set on their account, they can view the non discount ticket.

If that doesn’t work for you’ll need a developer to create a function that works for your specific needs.


Oguzhan Altun

May 17, 2018 at 7:15 am

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.


Oguzhan Altun

May 17, 2018 at 7:20 am

Sorry, one more question:)
Is it possible to have 1 ticket selected by default for the relevant user?
i.e. 1 member ticket selected for users with um-member capability (and zero normal ticket)
1 normal ticket selected by default for all other users (and of course zero member ticket) ?

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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Oguzhan Altun 3 months ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!