• Resolved nleaney

    (@nleaney)


    Hi,

    I’m trying to refresh some of my Paid Memberships Pro members by updating the membership_enddate field and checking the ‘update existing users’ option as part of the import.

    The import is recognised as an update in the summary screen but the membership_enddate field isn’t being updated. I am able to make changes to other fields such as first_name, last_name or display_name

    The format I’m using for the date is correct – i.e. if I use the same template to create a new user, the record is imported correctly.

    Any ideas?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Javier Carazo

    (@carazo)

    Maybe the problem is in this line:

    if( !empty( $membership_subscription_transaction_id ) && ( $membership_status == 'active' || empty( $membership_status ) ) && !empty( $membership_enddate ) ){
    return;
    }

    If the user is created, the membership_subscription_transaction_id maybe is not empty and then it fails.

    Thread Starter nleaney

    (@nleaney)

    Sounds feasible although if I do an export, membership_subscription_transaction_id appears to be empty.

    Plugin Author Javier Carazo

    (@carazo)

    Yes, but that data in that loop, if you look at the add-on, which, by the way, that part of the code is directly from PMPro, not mine (they sent it to me to incorporate it), reads it from an object that is not the metadata that appears in the export.

    If you know how to work with code, try removing that condition. I can’t do it in the general plugin, and since the add-on is directly controlled by PMPro, I can’t do it either.

    Thread Starter nleaney

    (@nleaney)

    Sneaky. They claim that the import/export plugin that they provide (only available with the ‘Plus’ Subscription) is able to do it. I wonder why they are limiting the functionality you are allowed to provide πŸ€”

    Thanks for your help / pointer though. I’ll see if there’s anything I can do.

    Plugin Author Javier Carazo

    (@carazo)

    I am not a PMPro user and I don’t know anything about the importer you mention.

    All I can tell you is that when they released the new API, I had to redo the importer (myself) taking into account their instructions (using part of the code they provided me, which is what I mentioned you can override, for example).

    Thread Starter nleaney

    (@nleaney)

    Thanks again. Doesn’t like that’s it πŸ™

    My users do not use subscriptions and the ID is not set. I’ll try to look through the code to see if I can find out why membership_enddate isn’t being updated. It’s included in the membership level array.

    FYI, the import file (for a new member) looks like this: AF1944_New_Annual_Members_Template_Nigel_Leaney_Test.csv

    The import file for an updated member looks like this: AF1944_Annual_Members_Renewals_2026.csv

    Plugin Author Javier Carazo

    (@carazo)

    Maybe the problem is the format of the date?

    Thread Starter nleaney

    (@nleaney)

    If that were the case, wouldn’t the import used to create a new user fail too?

    Plugin Author Javier Carazo

    (@carazo)

    Yes but in this csv the date is bad formed. You should use yyyy-mm-dd hh:ii:ss

    Thread Starter nleaney

    (@nleaney)

    I’ll give it a try but the format I’ve used is the same in both files

    Plugin Author Javier Carazo

    (@carazo)

    yes… as I told you, this part of the code came from PMPro. I could try to fix it if there is some problem here but maybe they do not allow change it for active subscriptions for some reason.

    Thread Starter nleaney

    (@nleaney)

    I’ve tried the updated format but no difference. Thanks again for your time on this.

    Plugin Author Javier Carazo

    (@carazo)

    Do some tests with our code, if you achieve it, let me know.

Viewing 13 replies - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.