• Hello,

    I want to permanently store the startdate of a user.

    I want to permanently store the original start date that someone first became a member regardless of how many subscription terms they went through or how many times they changed or canceled their membership.
    Does that make sense?

    Has anyone ever done this before?

    Im thinking that I need to create a new user meta field to store this info and somehow check if the field has a value upon order success. if it already has a value, leave it alone, otherwise if the field is empty, populate it with the startdate.

    perhaps I could use the pmpro_added_order hook or the pmpro_after_set_current_user hook?

    I would like it to work both when a user buys a membership or when an admin assigns a membership to a user.

    also it should only record the date if the order is successful.

    I dont care if then the user lets the membership expire or they cancel it, I still want that very first startdate to be recorded.

    Im not sure where or when to execute my code, which hook to use?

    Any ideas or insight into how I might accomplish this would be greatly appreciated.

    https://www.ads-software.com/plugins/paid-memberships-pro/

Viewing 1 replies (of 1 total)
  • Hey there,

    Actually, every time a user’s membership level is changed, a new record is inserted into the pmpro_memberships_users table, so (as long as the database hasn’t been altered!) you should be able to just grab the first record for that user id.

    Hope that helps!

    Thanks,
    Jess

Viewing 1 replies (of 1 total)
  • The topic ‘Permanently storing the startdate’ is closed to new replies.