I’m using Gravity Forms with Gravity Perks Nested Forms.
In my form, the user can add products through a nested form. The nested (child) form has a Product field (type: radio buttons) with 4 product options, each with its own price.
The user can add multiple products, one per nested entry, and I want the following logic:
First time a product is added → full price
Second time and beyond (duplicates of the same product) → discounted price
So for example:
“Product A” = $20 the first time, then $10 for each additional
“Product B” = $25, then $15 for each additional, etc.
Can Conditional Pricing detect and apply different pricing for repeated products across nested entries?
Or would I need to handle this with PHP using something like gpnf_entry_pre_save?
This should be possible using Nested Forms and Conditional Pricing, without the need for custom code. Here’s how you can set it up:
Add a hidden Number field to the parent form, enable calculations, and use the Nested Form merge tag to count the number of child entries, like so: {:10:count}.
Pass the value from this Number field into a hidden field on the child form using the Parent Merge Tags feature. This ensures the child form always receives the current count of entries added to the Nested Form field.
You can then use the value of this hidden field in the child form to set up conditional pricing. For example, if the count is 0, set the price to 20; if it’s greater than 0, set the price to 10.
Feel free to test this setup and see if it meets your needs. If you have any questions or run into any issues, don’t hesitate to reach out to our support team, we’ll be happy to have a closer look and assist further.