Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multiple selection of membership levels for PMPro integration #14

Open
ilbattista opened this issue Jun 6, 2023 · 3 comments
Open

Comments

@ilbattista
Copy link

Dear developer,
this plugin works very well and I thank you for your work.
I would like to make a suggestion, in the Paid Membership Pro integration you can only add just one membership level to make the tickets purchasable or viewable.
Is it possibile to modify that part to have the possibility to indicate more than one membership level simultaneously to which apply the plugin effects?

Thank you in advance and best regards

@Shadowsong13
Copy link

I too am interested in a solution to this. I've tried to add multiple roles with comma separated and even with AND and OR separation between the different member roles. 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. I have a license with The Event Tickets/Event Calendar but by license with Paid Memberships Pro ended for me last month, and can't renew until next year for budget reasons with the company. So I can't contact their official support for them. I'll try with their support at Wordpress.org plugins for the free support.

If I hear anything I'll report back here. But I hope devs here can come up with a solution if not as this will really help.

@ideadude
Copy link

This should be possible. Some notes:

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 (http://php.adamharvey.name/manual/en/function.explode.php) the string into an array. Then pass that array to pmpro_hasMembershipLevel().

@Shadowsong13
Copy link

Awesome prompt reply! I'll definitely let my client know about your support so they can get the money together to renew their membership. With that said, I'll also send this to the Event Ticket support person I'm talking with via email. Hopefully they can get something going. I'm sure this would be helpful for at least the two of us here :) and those that don't post or look into solutions online.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants