strangerstudios / pmpro-gift-levels

Allow members to purchase gift codes for membership at checkout.
https://www.paidmembershipspro.com/add-ons/pmpro-gift-levels/
8 stars 12 forks source link

Process to migrate old gift level purchases to order meta. #45

Open dparker1005 opened 3 years ago

dparker1005 commented 3 years ago

This is a enhancement request based off of a conversation in #22.

In PMPro Gift Levels v1.0, we are beginning to save the gift code that is purchased into order meta; however, sites that were using PMPro Gift Levels before v1.0 do not currently have a way to add that metadata for old purchases. In order to find the order that was likely used to purchase a gift code, we would need to:

  1. Get the start date of the gift code
  2. Get the user associated with the gift code by looking through usermeta
  3. Find an order for that user for the day after the gift code starts

The steps above can run into issues if multiple gift codes were purchased on the same day or if the start date of the code or the order date is changed. Perhaps a quicker solution would be to add a field to the "Edit Order" page for admins to manually link a gift code to the order, though this would not be sufficient for larger sites.

More thought would be needed to create a solid migration process.

kimcoleman commented 1 month ago

Do we think this is necessary at this point? We could still consider but as its 3 years later now I would think this is less of an issue to spend cycles on today.