How to Build a Player Roster with Age-Based Pricing

Register players with age-based registration fees in a single form submission.

This article requires the GP Nested Forms perk.

Buy Gravity Perks to get this perk plus 46 other premium Gravity Forms plugins!

View Plugin Buy Gravity Perks

One of our favorite things to see is when a customer combines a couple of our perks together to create a form that saves them and their users time. The following tutorial is one of those occasions. A customer wrote into Support with a question about their form and when I tested it I said to myself, “This is really clever!” That inspired me to write this tutorial so I could share what I learned.

Let’s dive in.

Overview

In this tutorial, we’re going to create a single form that performs multiple functions:

  1. Register multiple players on a team.
  2. Adjust each player’s registration fee based on the player’s age.
  3. Process the entire registration in a single form submission.

To accomplish this, we’re going to combine a couple of our Perks:

Try this demo to get a feel for how it works.

Steps

  1. Create the Players Form
  2. Calculate Age
  3. Set up Conditional Pricing
  4. Create the Team Form
  5. Calculate the Registration Total

Step 1 – Create the Players Form

Create a new form and name it “Players”. Add the following fields to the form:

  • Name
  • Date
  • Number
  • Product

Name the Date field “Date of Birth”. If you want to limit the age of the players for the team, check out GF Limit Dates.

Step 2 – Calculate Age

We’ll calculate each player’s age in the Number field using GF Date Time Calculator. Check the Enable Calculation checkbox and insert the merge tag for the “Date of Birth” field. Add the :age merge tag modifier to it to automatically calculate age.

Step 3 – Set up Conditional Pricing

With age calculation in place, we can use GF Conditional Pricing to set up pricing based on the player’s age.

Step 4 – Create the Team Form

With the Players form completed, it’s time to set up the Team form. Add a Nested Form Field to the form and select the Players form.

Step 5 – Calculate the Registration Total

Add a Product field to the form, set the Field Type to Calculation, and use the :total merge tag modifier to total up the player registration fees from the Nested Form.

Wrapping Up

With this last step completed, we now have a form to register a team with a full player roster that will automatically adjust the price based on a player’s age. It’s easy for a user to submit an entry and all the heavy lifting is handled with a handful of Perks.

Taking It Further

The Conditional Pricing in this form is dependent on the value in the Age field. If the value in this field is changed, the price changes. To prevent this, either set it as hidden or use GF Read Only.

You can set an age limit for your teams with GF Limit Dates. Set a minimum or maximum date range to prevent players that are too young or too old from joining the team.

Comments

    1. Scott Ryer
      Scott Ryer Staff November 6, 2023 at 9:28 am

      Hi Dottie,

      You can change the message using the Entry Labels setting. Add the words “player” and “players” to the Singular and Plural settings, and the message will update on your form.

      GP Nested Forms Settings

Leave a Reply

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

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.

Grab a bundle of free Gravity Forms plugins

Enter your email and receive our most popular free plugins and snippets, plus access to hundreds of others.

This field is for validation purposes and should be left unchanged.