Skip to content

Instantly share code, notes, and snippets.

@MaryOJob
Last active January 22, 2020 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save MaryOJob/f2c444ccb3ceca4aa341aeb07cc5becc to your computer and use it in GitHub Desktop.
Save MaryOJob/f2c444ccb3ceca4aa341aeb07cc5becc 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 sponsored Members Add On up and configured.
This code should also be added together with your configured sponsored members code in your PMPro customizations Plugin: https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
This script is an example that allows level 2 to purchase 5 membership accounts for level 3 but
have level 3 individualy pay $20 for their membership accounts.
Please see the add on guide for more attributes that can be configured for your sponsored members add on here: https://www.paidmembershipspro.com/add-ons/pmpro-sponsored-members/
*/
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'
)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment