Skip to content

Instantly share code, notes, and snippets.

@kimcoleman
Created October 1, 2020 15:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kimcoleman/34b0ed7df368769f46021a3d70f1b150 to your computer and use it in GitHub Desktop.
Save kimcoleman/34b0ed7df368769f46021a3d70f1b150 to your computer and use it in GitHub Desktop.
Require a sponsor code for the "child" level checkout when using Paid Memberships Pro and the Sponsored/Group Membership Add On.
<?php
/*
* Require a sponsor code for the "child" level checkout when using
* Paid Memberships Pro and the Sponsored/Group Membership Add On.
*
* You can add this recipe to your site by creating a custom plugin
* or using the Code Snippets plugin available for free in the WordPress repository.
* Read this companion article for step-by-step directions on either method.
* https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/
*
*/
global $pmprosm_sponsored_account_levels;
$pmprosm_sponsored_account_levels = array(
1 => array(
'main_level_id' => 1,
'sponsored_level_id' => 2,
'seats' => 10,
'discount_code_required' => true,
),
);
@laurenhagan0306
Copy link

This recipe is included in the blog post on "Require a Sponsor Code for Checkout for a Sponsored Membership Level" at Paid Memberships Pro here: https://www.paidmembershipspro.com/require-a-sponsor-code-for-checkout-for-a-sponsored-membership-level/

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