Title: Multiple Groups Solution
Last modified: January 30, 2017

---

# Multiple Groups Solution

 *  Resolved [Leinad4Mind](https://wordpress.org/support/users/leinad4mind/)
 * (@leinad4mind)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/multiple-groups-solution/)
 * 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](https://wordpress.org/support/users/leinad4mind/).

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

 *  Plugin Author [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/multiple-groups-solution/#post-8719178)
 * Hi [@leinad4mind](https://wordpress.org/support/users/leinad4mind/),
 * Thank you for getting in touch and choosing Paid Memberships Pro.
 * For clarification, are you referring to BuddyPress groups?
 *  Thread Starter [Leinad4Mind](https://wordpress.org/support/users/leinad4mind/)
 * (@leinad4mind)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/multiple-groups-solution/#post-8720625)
 * 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](https://wordpress.org/support/users/leinad4mind/).
 *  Thread Starter [Leinad4Mind](https://wordpress.org/support/users/leinad4mind/)
 * (@leinad4mind)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/multiple-groups-solution/#post-8725474)
 * 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](https://wordpress.org/support/users/leinad4mind/)
 * (@leinad4mind)
 * [9 years, 4 months ago](https://wordpress.org/support/topic/multiple-groups-solution/#post-8727653)
 * 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](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multiple-groups-solution/#post-8729861)
 * 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/](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](https://wordpress.org/support/users/leinad4mind/)
 * (@leinad4mind)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multiple-groups-solution/#post-8729959)
 * 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](https://wordpress.org/support/users/leinad4mind/)
 * (@leinad4mind)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multiple-groups-solution/#post-8730643)
 * 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](https://wordpress.org/support/users/leinad4mind/).
    -  This reply was modified 9 years, 3 months ago by [Leinad4Mind](https://wordpress.org/support/users/leinad4mind/).
 *  Plugin Author [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multiple-groups-solution/#post-8730867)
 * 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](https://gist.github.com/strangerstudios/dccc7944ca2d8cd993de#file-pmpro_after_change_membership_level_cancel-php)
 * I hope this code helps.
 *  Thread Starter [Leinad4Mind](https://wordpress.org/support/users/leinad4mind/)
 * (@leinad4mind)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multiple-groups-solution/#post-8731047)
 * Thanks, with this code I dont even need to edit the core files, thanks again!
   🙂
 *  Plugin Author [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * (@andrewza)
 * [9 years, 3 months ago](https://wordpress.org/support/topic/multiple-groups-solution/#post-8733198)
 * You’re most welcome [@leinad4mind](https://wordpress.org/support/users/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.

 * ![](https://s.w.org/plugins/geopattern-icon/paid-memberships-pro_f1dacb.svg)
 * [Paid Memberships Pro - Content Restriction, User Registration, & Paid Subscriptions](https://wordpress.org/plugins/paid-memberships-pro/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/paid-memberships-pro/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/paid-memberships-pro/)
 * [Active Topics](https://wordpress.org/support/plugin/paid-memberships-pro/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/paid-memberships-pro/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/paid-memberships-pro/reviews/)

## Tags

 * [multiple](https://wordpress.org/support/topic-tag/multiple/)

 * 10 replies
 * 2 participants
 * Last reply from: [Andrew Lima](https://wordpress.org/support/users/andrewza/)
 * Last activity: [9 years, 3 months ago](https://wordpress.org/support/topic/multiple-groups-solution/#post-8733198)
 * Status: resolved