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.
Sounds feasible although if I do an export, membership_subscription_transaction_id appears to be empty.
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.
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.
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).
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
Maybe the problem is the format of the date?
If that were the case, wouldn’t the import used to create a new user fail too?
Yes but in this csv the date is bad formed. You should use yyyy-mm-dd hh:ii:ss
I’ll give it a try but the format I’ve used is the same in both files
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.
I’ve tried the updated format but no difference. Thanks again for your time on this.
Do some tests with our code, if you achieve it, let me know.