Use this code recipe in combination with custom user fields to set up a checkout field that adjusts the membership price, either for the initial payment, recurring payments, or both.

Example Use Cases for Price-Adjusting User Fields

There are several use-cases that need this type of option that change’s your level’s price. Some ideas, to name a few:

  • An association that publishes a quarterly magazine. Allow members to optionally pay extra to receive a physical copy via mail.
  • A food-box or equivalent that has a frequency or quality selection, such as daily or 3 times a week OR good, better, and best.
  • A health coach who wants to add an optional “weekly call” with the client.
  • An education or online learning site that allows you to select one or more additional courses in your membership.
Banner for Advanced Code Recipe Tutorial for Paid Memberships Pro

The Code Recipe

Adding the Recipe to Your Website

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.

Duplicate lines 6-9 for as many fields as you want. The if(!empty($_REQUEST['option1']) || !empty($_SESSION['option1'])) line should be updated to the appropriate field name. You may also want to add a “hint” to the field so that your members know how their price will be adjusted based on their selection(s).

Free Course: Membership Site Development—The Basics

Develop a deeper understanding of membership site development in this beginner-level course. Learn how to make your site work better, save yourself time and money, and improve your site's performance.

Featured Image for Membership Site Development Course: The Basics
Was this article helpful?
YesNo