How can I set a limit on a calculated discount?

I made a Stripe-enabled payment form for my clients to pay invoices: Evo Web Dev » Evo Invoice Payment

To combat resistance from some clients, I added a 3% discount that is calculated after they enter the invoice amount:
– ({Invoice Amount:13} * .03)

That works great, but I’d like to cap the discount at $50. I don’t see a way to do that. Any ideas?

You can make use of the filter gform_coupons_discount_amount to override the applied discount amount and restrict in this way. You’d want to employ both the javascript and PHP version in order for the changes to affect both the front end when filling the form and the entry as it is submitted.

Just noticed that you are using a calculation to apply the discount, rather than a coupon. Oops. I wonder if the plugin GP Advanced Calculations by Gravity Wiz might be of use here.

Looks like GP Advanced Calulations might do it. Will dig into it later to see.

Thanks!

BTW, why are product prices not available for use with conditionals?

In this case, for instance, if the invoice was under $1670 we could subtract the calculated amount, and if $1670 or more, subtract $50.

Hi Ray. Support for product prices in conditional logic has been requested in the past, but it’s not included in the plugin currently. If you would like to add a vote for that feature, please add a note to our product roadmap. Click the blue plus in the lower left on this page to add a note for our product team:

Thank you.​​

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.