One of the most requested multiple memberships workarounds is the ability to offer single courses for purchase. This code recipe syncs the purchase of a single page using Addon Packages with WP Courseware, allowing members to individually purchase one or more courses.


Plugins Required

This code recipe requires four separate plugins:

  • Paid Memberships Pro,
  • Addon Packages add on (for selling access to a single page/post),
  • WP Courseware, and
  • the PMPro Addon Packages for WP Courseware plugin via the code recipe below.

How to Set it Up

  1. In the WordPress admin, add a new page for each course. This is basically just a “sales page” for the course and will not hold any of the post content.
  2. Set the “Price” for the course in the “PMPro Addon Package Settings” field.
  3. Set the Membership Levels that can make the purchase of the course addon via the “Require Membership” box. Note that these levels will not gain automatic access to the course, they are just the levels that a member must have or be assigned to at checkout in order to complete purchase.

Now, there’s a bit of simple coding to do. In your theme’s functions.php file or a helper PMPro Customizations plugin, copy these lines:

global $pmpro_addon_pages_for_courses;
$pmpro_addon_pages_for_courses = array(
3366 => 1,
3368 => 2,
);

Update the array values (format is {WP Post ID} => {Course ID}) for each page to course relationship. This is the key step that associates your sales page with the course purchased.

This works independent of the official PMPro for WP Courseware bridge plugin.


The Code Recipe

This code recipe requires a PMPro Plus Account or higher.

View Membership Options


Click here for information about multiple memberships workarounds.


Leave a Reply

Your email address will not be published. Required fields are marked *