Forked from MaryOJob/my_pmpro_sponsored_members_charge_recievers.php
Last active
April 3, 2021 04:01
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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' | |
| ) | |
| ) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/