How can I hide the credit card fields for transactions that total zero?

Some of the registrations for the form I’m creating will end up as zero dollar transactions. However, I can’t seem to find a way to hide the credit card fields for those transactions. If I don’t hide the credit card fields, then the form requires the user to enter their credit card information.

Is there a way to hide the credit card fields for zero dollar transactions?

Gravity Forms doesn’t enable conditional logic on total fields (https://docs.gravityforms.com/enable-total-field-with-conditional-logic/). What you can do instead is set up conditional logic based on the inputs that make the total zero. For me it’s a discount code. So I set the credit card field to hide if certain discount codes are entered in the Discount Code field. If your conditions are more complex than a single discount code I wrote up a workaround to use and/or conditional logic in a form. https://builtwithgravity.com/and-or-conditional-logic-for-gravity-forms/

Don’t forget you’ll need to set the same conditional logic for your payment feed or else the submitter will get an error.

2 Likes

This is ridiculous. I see posts going back over eight years asking for a solution to this. It is just silly for a user to see credit card fields when there is no balance. With several products and quite a few coupon codes, it is impossible to create the conditional logic and maintain it when things change. You need a better workaround for this. Currently I have the credit card field marked as not required, but that means any can place an order without actually paying.

Please give this a higher priority than you have the last eight years. Other plugins have figured this out - you should be to as well.

1 Like

Hi Brady. Thank you for your feedback. The best way for you to have your voice heard is to leave a note for the product team on our product roadmap. If you would like to suggest that this be prioritized and given more attention, I recommend adding that to our product roadmap. Click the blue :heavy_plus_sign: in the lower left on this page to add a note for our product team:

https://www.gravityforms.com/gravity-forms-roadmap/

Thank you.

Actually, You can do it. I’ve been doing it for quite sometime now. See the link below.

2 Likes

I’m sorry to say that this doesn’t work. While the code does enable Total to be used in conditional logic rules once you enable it the Stripe Credit Card form still appears even if the total is zero.

Please disregard. It is working fine! :slight_smile:

2 Likes