PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Hide Credit Card Fields When Total Is Zero

  1. How can I hide the credit card fields if the total is zero? The "total" field does not appear as an option for conditional logic.

    There are circumstances where we offer customers a 100% discount on the product price, but we still need them to go through the checkout.

    Posted 11 years ago on Saturday August 18, 2012 | Permalink
  2. Can you post a link to this form online please?

    How are you processing credit cards now? Are you using one of the PayPal add-ons or the Authorize.net add-on, or some other solution?

    Posted 11 years ago on Saturday August 18, 2012 | Permalink
  3. Here is a link to the Dev Site: http://mastersports.kingdesk.com/academy/classes/baseball-101-2/

    Click on the "Register Now" button. Once you create an account, you will be taken to the Checkout form.

    Use promo code "100p" for a 100% discount.

    On the second page of the Checkout form, credit card information (and address verification) are required. I'd like these to only be required if the total is greater than zero.

    I am using the Authorize.net Add-On.

    (The Auth.net Add On is in development mode. Transactions are not live. You can use the cc number "4111 1111 1111 1111" if you need to)

    Posted 11 years ago on Saturday August 18, 2012 | Permalink
  4. I see the problem now after trying to configure a form like this. To use conditional logic for the Credit Card information, (authorize.net) you need to have a drop down, radio button or checkbox field as the condition. It does not appear that the total can be used as a condition here. Let me check with the developers to see if there is a work around or something simple I am overlooking. Thank you.

    Posted 11 years ago on Sunday August 19, 2012 | Permalink
  5. Do you have any new info from the developers? It would be very helpful to hide all the payment info if the total is zero.

    Additionally, your assessment seems to be incorrect. I am able to choose text inputs and hidden fields for conditional logic. I just can't choose the total field (as it does not show up in the list).

    Posted 11 years ago on Monday August 27, 2012 | Permalink
  6. I'll check with them again on Tuesday about using the total as a condition.

    Posted 11 years ago on Tuesday August 28, 2012 | Permalink
  7. Hi, kingjeffrey,

    My original thought was that you could use the "gform_pre_render" hook and manually create the conditional to use the total field. This only caused the functionality to fire the first time the page loaded when I set it up in my test environment; so I abandoned playing with that.

    But then I had another thought, since you have the field with the promotional code, why don't you use that for your conditional on the credit card field? When the promo code is "100p", hide the credit card field.

    Will that work for you?

    Posted 11 years ago on Thursday August 30, 2012 | Permalink
  8. Dana Cobb,

    But then I had another thought, since you have the field with the promotional code, why don't you use that for your conditional on the credit card field? When the promo code is "100p", hide the credit card field.

    Unfortunately not. I am using AJAX to query a database to validate and apply the promocode. I do not have a fixed set of promo codes. Plus, if I use conditional logic to hide the credit card info, it will no longer be tested for the required validation, so I don't want to step to far outside the existing infrastructure.

    My backup plan (and it is an undesired hack) is to create a hidden field that can be updated dynamically by javascript when the total is zero, and hide the credit card fields when the condition is met on the hidden (and redundant) field.

    Posted 11 years ago on Tuesday September 11, 2012 | Permalink
  9. Any progress on allowing the "total" field to be available within conditional logic?

    Posted 11 years ago on Monday November 19, 2012 | Permalink
  10. I'll bring this to Dana's attention to see if there is any update.

    Posted 11 years ago on Tuesday November 20, 2012 | Permalink
  11. There are a lot of complexities surrounding the total field. There have been discussions regarding allowing it with conditional logic, but this is not in any future plans or on the roadmap at this time, and most likely not any time soon.

    Posted 11 years ago on Tuesday November 20, 2012 | Permalink
  12. I found a workable solution to this problem, described here: http://www.gravityhelp.com/forums/topic/authorizenet-hide-when-total-is-0#post-178479

    Posted 11 years ago on Wednesday March 20, 2013 | Permalink