Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save travislima/831714c97abb78645519eadd9846a03d to your computer and use it in GitHub Desktop.

Select an option

Save travislima/831714c97abb78645519eadd9846a03d to your computer and use it in GitHub Desktop.
Allows sponsored recipients to individually pay for the seats given by their sponsored giver.
<?php
/*
* This codes requires you to have the PMPro Sponsored/Group Members Add On - https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
* This code recipe is an example that allows membership level 2 to purchase 5 group membership accounts for membership level 3.
* However, level 3 members will need to individualy pay an initial payment of $20 for their membership accounts.
*/
global $pmprosm_sponsored_account_levels;
$pmprosm_sponsored_account_levels = array(
//set 5 seats at checkout
2 => array(
'main_level_id' => 2, //redundant but useful
'sponsored_level_id' => array(3), //array or single id
'seats' => 5, // the number of membership accounts a sponsored member (giver) can purchase
'discount_code' => array(
'initial_payment' => '20', // the amount you want sponsored recipients to each pay for their accounts
'billing_amount' => '0'
)
)
);
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Allow Sponsored Members to pay for their own accounts" at Paid Memberships Pro here: https://www.paidmembershipspro.com/allow-sponsored-members-to-pay-for-their-own-accounts/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment