Hi @leinad4mind,
Thank you for getting in touch and choosing Paid Memberships Pro.
For clarification, are you referring to BuddyPress groups?
No, when I say groups I mean Levels from PMPro that is like a group.
So when a payment fails it will remove the user from the level, right?
So if the user buys the Level 1 and the payment fails when it will automatically renew, he will be removes, right?
But I wanted not to remove the user from the Level 1, I wanted instead to move to Level 2.
That way, all users that are on Level 1 and their membership expires/cancelled, then they’ll be moved to Level 2.
-
This reply was modified 9 years, 4 months ago by
Leinad4Mind.
If writing that is too much trouble for you guys, can you guys at least tell me which file has the removing group function?
I’ve fixed my problem by editing: /wp-content/plugins/paid-memberships-pro/includes/functions.php
if(empty($level)) //cancelling membership
{
$level = 0;
}
to this:
if(empty($level)) //cancelling membership
{
$level = 2;
}
Thank you for the feedback. It’s not good practice to edit the PMPro files directly, however here is documentation to do this using a function – https://www.paidmembershipspro.com/change-pmpro-membership-cancellation-to-set-expiration-date-for-next-payment-instead-of-cancelling-immediately/
I hope this helps, please let me know if you have any further questions 🙂
Thanks but in the moment I cant afford to be a member, orelse I would gladly be.
The future will tell.
Best regards and thanks for your time.
Still need help on this.
With the code above I had still 1 little problem.
What I want is, when a member is on Level ID 1 and that level expires via cron, then move it to Level ID 2, and then when Level ID 2 expires then move it to None.
I need a little guidance here.
I guess I was able to do it, I’ve edited crons.php
and changed:
//remove their membership
pmpro_changeMembershipLevel(false, $e->user_id, 'expired');
to this:
//remove their membership
if($e->membership_id == "1")
pmpro_changeMembershipLevel(2, $e->user_id, 'expired');
else
pmpro_changeMembershipLevel(false, $e->user_id, 'expired');
-
This reply was modified 9 years, 3 months ago by
Leinad4Mind.
-
This reply was modified 9 years, 3 months ago by
Leinad4Mind.
You’re most welcome, here is a gist that helps you assign users to a specific level if they are canceling or expiring from a certain level – https://gist.github.com/strangerstudios/dccc7944ca2d8cd993de#file-pmpro_after_change_membership_level_cancel-php
I hope this code helps.
Thanks, with this code I dont even need to edit the core files, thanks again! 🙂
You’re most welcome @leinad4mind!
I am going to mark this thread as resolved.
Have a great day further 🙂