• Resolved Leinad4Mind

    (@leinad4mind)


    Is there any way/trick to have like 2 groups aka levels in 1 subscription?

    Example. User1 subscribes to Level ID 1 (with renew value), and that level would put the user1 in 2 groups. VIP (group selected) and Special group.
    After the expiration of that Level ID 1 the user would be moved to the Special Group.

    Is that possible? Instead of removing the group, changing to another group? Or maybe changing to a Level ID 2 named Special, and then changing to that Level instead of removing?

    Best Regards

    • This topic was modified 9 years, 4 months ago by Leinad4Mind.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Andrew Lima

    (@andrewza)

    Hi @leinad4mind,

    Thank you for getting in touch and choosing Paid Memberships Pro.

    For clarification, are you referring to BuddyPress groups?

    Thread Starter Leinad4Mind

    (@leinad4mind)

    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.
    Thread Starter Leinad4Mind

    (@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?

    Thread Starter Leinad4Mind

    (@leinad4mind)

    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;
    
    	}
    Plugin Author Andrew Lima

    (@andrewza)

    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 🙂

    Thread Starter Leinad4Mind

    (@leinad4mind)

    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.

    Thread Starter Leinad4Mind

    (@leinad4mind)

    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.
    Plugin Author Andrew Lima

    (@andrewza)

    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.

    Thread Starter Leinad4Mind

    (@leinad4mind)

    Thanks, with this code I dont even need to edit the core files, thanks again! 🙂

    Plugin Author Andrew Lima

    (@andrewza)

    You’re most welcome @leinad4mind!

    I am going to mark this thread as resolved.

    Have a great day further 🙂

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

The topic ‘Multiple Groups Solution’ is closed to new replies.