strangerstudios / pmpro-sponsored-members

Generate a discount code for a main account holder to distribute to sponsored members.
https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/
15 stars 27 forks source link

Discount Codes for child accounts not renewing when parent membership renews. #111

Closed andrewlimaza closed 1 year ago

andrewlimaza commented 2 years ago

Describe the bug Child discount codes will always expire, and not renew upon parent account renewal.

Code reference: https://github.com/strangerstudios/pmpro-sponsored-members/blob/dev/pmpro-sponsored-members.php#L243 (Removing this to let the code never expire should be okay)

To Reproduce Steps to reproduce the behavior:

  1. Signup for a parent account.
  2. Set the expiration date of the code to a past date (to "spoof" the 1 year period)
  3. Try checkout with the code. (Parent account/membership still active and valid)
  4. See error

Expected behavior Proposed change is to set the discount code to never expire when created at parent checkout, as there are checks on registration that the parent account is active.

Code reference: https://github.com/strangerstudios/pmpro-sponsored-members/blob/dev/pmpro-sponsored-members.php#L713-L747

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

michaelbeil commented 1 year ago

A customer (ticket 447249) is running into this:

We have had a renewal of a membership who’s child members have dropped off again (all of them). They paid by invoice yesterday and then all their child member orders were changed to inactive, then a new order can be seen with no discount code and their level set to None. Screenshot attached. What is even worse is we have an event for sale on the website with cheaper prices if you are logged in as a member and people are going on the site and their child membership is no longer live when it should be (their child membership orders are canceled again. Even though the parent member renewed with payment by invoice).

MaryOJob commented 1 year ago

Moderators Only: #457617

ipokkel commented 1 year ago

Moderators Ony: #463233