Support

Home Forums WP User Integration Restricting Ticket using WP User Capability and Restrict Content Pro

Restricting Ticket using WP User Capability and Restrict Content Pro

Posted: December 22, 2020 at 2:49 pm


GravityStack

December 22, 2020 at 2:49 pm

We are trying to restrict an event ticket to users with A restrict content pro membership ID of 2 or 4.

In the Ticket Capability Requirement field, we’re trying “in_array( 2, rcp_get_customer_membership_level_ids() )” as per the RCP documentation.

We’ve tried a few other combinations but haven’t gotten it to work. It’s restricting the ticket for everyone, regardless of membership level.

References
1. https://eventespresso.com/product/eea-wp-user-integration/ (mentions working with Restrict Content Pro)

2. https://help.ithemes.com/hc/en-us/articles/360050095493-Can-I-hide-widgets-from-non-members- (has the code snippets for restricting content)

3. https://ee-screenshots.s3.amazonaws.com/ee4/ee4-s2member-roles-tickets.jpeg (Code sampe for the S2 membership system)


Tony

  • Support Staff

December 23, 2020 at 5:27 am

Hi there,

We are trying to restrict an event ticket to users with A restrict content pro membership ID of 2 or 4.

The option within Event Espresso checks for capabilities rather than user levels from X plugin. The reason we do this is to allow it to work with various different membership plugins and not just specific ones.

Content Membership Pro level ID’s are specific to Content Membership Pro, so the core EE code doesn’t check for those.

In the Ticket Capability Requirement field, we’re trying “in_array( 2, rcp_get_customer_membership_level_ids() )” as per the RCP documentation.

You can’t input code into the capability field, the means EE s going to check if the user literally has a 'in_array( 2, rcp_get_customer_membership_level_ids() )' capability on their account, which they will not and is then why the ticket gets restricted for everyone.

For the above check to work you’ll need a snippet that explicitly checks for Restrict Content Pro membership levels.

Do you always use the membership level IDs to compare with?

Will your tickets always be restricted to any one of levels input into the field, for example, you can set ‘2,4,5’ in the ticket capability field and that would be available to any members with level 2 OR 4 OR 5?


GravityStack

December 23, 2020 at 9:38 am

Thanks for the additional detail Tony…

For the above check to work you’ll need a snippet that explicitly checks for Restrict Content Pro membership levels.

I’m struggling to figure out what “snippet” would work here. iThemes (who bought Restrict Content Pro) are off for the holidays and aren’t helpful at the momemnt. Any suggestions on how I might suss that out?

Answers to your other questions: Most of the tickets we do will have tickets restricted to certain membership levels. Some tickets would be for multiple membership levels. yes.


Tony

  • Support Staff

December 28, 2020 at 7:21 am

I’m struggling to figure out what “snippet” would work here. iThemes (who bought Restrict Content Pro) are off for the holidays and aren’t helpful at the momemnt. Any suggestions on how I might suss that out?

As you’ve submitted a support token for this, i can create the snippet for you, however…

Answers to your other questions: Most of the tickets we do will have tickets restricted to certain membership levels. Some tickets would be for multiple membership levels. yes.

You said most ticket, meaning some will not have a restriction? That’s fine if so I’m just confirming how this will work before providing a solution that then gets you stuck later down the line.

With regards to multiple membership levels, that ticket will be available to each membership level, right?

So a ticket can be available to Member level 1 or level 2 or level 3

Users would not have multiple membership levels at the same time, correct? Meaning you don’t need something that will restrict a ticket unless the user is Membership level 1 AND level 2?

(That may sound like a strange question but we’ve had it requested previously)


GravityStack

December 29, 2020 at 9:07 am

Thanks…
I’ll do my best to answer your questions clearly.

Members will only have one membership at a time.

Common scenarios:
Ticket restricted to member level 1
Ticket restricted to someone who has either member level 1 or level 2.

Thanks,

Scott


GravityStack

December 30, 2020 at 8:58 am

Hoping to get a resolution to this today; my Client is planning a New Year’s promotion where tickets are going on sale.


Tony

  • Support Staff

December 31, 2020 at 10:50 am

Hi Scott,

Apologies for the delay but I’ve added the snippet to your site for this and replied to your support token.

Please let me know if the snippet works for you.

The support post ‘Restricting Ticket using WP User Capability and Restrict Content Pro’ 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.

Event Espresso