• Resolved timshadow3

    (@timshadow3)


    I’m trying to use this plugin https://theeventscalendar.com/extensions/members-only-tickets/.

    I’ve tried to add multiple roles with comma separated and even with AND and OR separation between the different member roles. For example Gold and Silver and Platinum. Or with commas but it only works when one membership level is in the Settings for the Event Tickets.

    Talking with The Event Tickets support they mentioned using AND OR but that doesn’t appear to work. Their support then said to contact Paid Membership Pro support to find out how they handle multiple memberships and the syntax as they, Event Tickets, don’t have access to the source code of Paid Memberships Pro.

    I have an active license with The Event Tickets/Event Calendar but by license with Paid Memberships Pro ended for me last month, and I can’t renew yet until next year, for budget reasons, with the company I’m working with. So I can’t contact Paid Membership Pro official support for awhile so I am reaching out here. Hopefully this is an easy answer.

    There is also another comment at the Github page here https://github.com/mt-support/tec-labs-members-only-tickets/issues/14.

    Here’s a link to a snippet of the Settings section in Event Tickets for the levels using “and” https://imgur.com/AdnC89l and here is an image of just using one membership level there and it does work with just one member level. Just not for multiple membership levels. https://imgur.com/CTBUOJe


    • This topic was modified 1 year, 2 months ago by timshadow3.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Jason Coleman

    (@strangerstudios)

    Hi, Tim. Sorry you’re getting bounced around for this. We should be able to help you and TEC figure this out.

    First, all of our source code, even for premium products, is available at GitHub: https://github.com/strangerstudios/

    In this case, the related code is all in the PMPro core plugin.

    Here’s where I think the TEC add on is checking if someone has a membership level: https://github.com/mt-support/tec-labs-members-only-tickets/blob/main/src/TEC_Labs/Integrations/Paid_Memberships_Pro.php#L88-L92

    The pmpro_haseMembershipLevel() function can take an array of level ids. When called this way it will return true if the user has ANY of the levels passed in (so effectively ORing the levels).

    You can’t pass in a comma separated string. The code there in the TEC add on could take the value from "{$this->get_id()}_required_membership_level_purchase" and check for commas then explode (https://php.adamharvey.name/manual/en/function.explode.php) the string into an array. Then pass that array to pmpro_hasMembershipLevel().

    Thread Starter timshadow3

    (@timshadow3)

    Thanks for the prompt reply! I’ll pass this along to the support person at Event Tickets right now via email. Hopefully this helps them.

    So currently, there is no way to add multiple levels, until they modify the Members Only Tickets add on?

    Plugin Author Jason Coleman

    (@strangerstudios)

    So currently, there is no way to add multiple levels, until they modify the Members Only Tickets add on?

    Correct. The form needs to be updated to save an array of level ids or include that extra code to convert something like “1,2,3” to an array. The PMPro function doesn’t accept things like “1,2,3” by default.

    Because I was on a roll here, I wrote a gist that should use the PMPro filters to support calls like pmpro_hasMembershipLevel(“1,2”)/etc.

    This is untested. Let me know if it works. You can add the code via the Code Snippets plugin or in a custom plugin.

    https://gist.github.com/ideadude/756cfd6d8b60993552b6146db900ce38

    I wouldn’t plan to use that code ongoing. TEC should update their add on. You can see how to split the string into an array in there.

    Plugin Author Jason Coleman

    (@strangerstudios)

    I probably should have just written a PR for the TEC addon. That’s cool it’s on their GitHub. I’ll see if someone on our team can help.

    Thread Starter timshadow3

    (@timshadow3)

    ?? you were on a role, I know I get that way when someone gives me something interesting. Thanks for that! It does seem to work. As a temp solution of course. I’ll await word from them. Can I share this link from you to TEC team or at the github listing to maybe help the other person looking for a solution? I don’t want to confuse or change things on the TEC end for a solution within their addon

    Plugin Support Jarryd Long

    (@jarryd-long)

    We’re going to look at pushing that PR to the repo, but in the meantime feel free to share this thread with them as well.

    Thread Starter timshadow3

    (@timshadow3)

    Thanks! I sent links and info to the customer service rep.

    Plugin Support Jarryd Long

    (@jarryd-long)

    Thanks for posting that @timshadow3 , we will also see what we can do from our end, I just can’t give an ETA right now on when it would be done.

    Feel free to reach out if there’s anything else we can assist with.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Members Only Tickets for Event Tickets integration’ is closed to new replies.