strangerstudios / pmpro-approvals

Grants administrators the ability to approve/deny memberships after signup.
https://www.paidmembershipspro.com/add-ons/approval-process-membership/
19 stars 29 forks source link

BUG: Conflict w/ Approvals and Addon Packages. #150

Open kimwhite opened 3 years ago

kimwhite commented 3 years ago

Describe the bug The site requires Approval of the First Level before signing up for paying levels. After approval, member signs up for the Second Level. Now that user is a member of Second Level user can not purchase Addon Packages (that should be accessible to their level)

To Reproduce Steps to reproduce the behavior:

  1. Enable, PMPro, Approvals Add On, Addon Package Add On
  2. First Level - Requires Approval? > YES. Admin must approve new members for this level.
  3. Second Level - Requires Approval? > YES. User must have an approved membership for a different level.
  4. Second Level - Which Level? (select the First Level)
  5. Create Addon Page - Require Second Level
  6. Sign up New Members with First Level and approve them
  7. Change member for to Second Level (purchase or change in admin)
  8. Return to buy Addon Package

Screenshots error-addon

Expected behavior Approved Member of one level, then purchases the second level (which requires first level approval) Members of the second level should be able to purchase Addon Package.

Isolating the problem (mark completed items with an [x]):

WordPress Environment

WP 5.8, PMPro 2.6.1.1, Approvals 1.4, Addon Packages 0.8

andrewlimaza commented 2 years ago

The workaround here would be to ensure that the AP level that is assigned doesn't require approval for another level:

  1. You may use the pmproap_text_level_id filter to adjust the default level for Addon Packages. Make sure that the post/thing you're buying has this level.

  2. Do not set this level to require approval for another level to checkout but rather "Approval by Admin".

I think a gist for this "issue" would be better as I can imagine not everyone would want to bypass approvals by default and would be more than happy to require approval. You may use the pmpro_approvals_level_restrict_checkout filter and set this to false if the $_REQUEST['AP'] isn't empty.