Check out our growing library of code snippets for Gravity Forms!
Ensure child form submissions don't exceed Gravity View balance
This code snippet ensures that child form submissions in Gravity Forms do not exceed the available balance recorded in a GravityView ledger. It validates disbursal requests against the user's balance, preventing over-allocation of funds across multiple pending and approved submissions.
Each array at the top of the snippet is for a different form with it's own ledger. You can use this snippet for as many forms/ledgers as many as you want, just make sure they all have the same structure and to replace the relevant id's.
Features
- Prevents over-disbursement by checking the requested amount against the available balance.
- Validates nested child form entries to ensure total requests do not exceed the ledger balance.
- Supports multiple forms by allowing configuration for different form setups.
- Includes pending disbursals in the balance calculation for real-time accuracy.
- Displays a detailed validation message when the requested amount exceeds the available balance.
- Efficiently retrieves and processes Gravity Forms entries with pagination for large datasets.
Install Using Code Snippets
This code is best installed directly on your site using the Code Snippets plugin.
Check Out the Code
Loading...
Stay Updated On This Snippet
Review this entry
You must be logged in to post a comment.