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.

Use one form to purchase all products?

  1. kevinmcgillivray
    Member

    I'm setting up a custom post type called "events" and using Gravity Forms with the auth.net addon for purchasing seats at the events. There will be multiple events with different names and prices. For simplicity (for my client) I'd like to use one form for any event registration and just change the price of the product based on a price set in the CPT at the time the form is rendered. Ideally I would also like to change the name of the product being purchases at the same time. Is there a way to alter these aspects of the form at runtime using a WP filter or hook?

    Thanks for your help.

    Posted 11 years ago on Saturday April 27, 2013 | Permalink
  2. kevinmcgillivray
    Member

    In case anyone is interested in this topic, I was able to figure this out using the "gform_pre_render" filter. I set up the form that I needed and then alter them on the fly using this filter to match whatever values I have on my event custom posts. It works pretty well and lets me do things limit form submissions based on how many tickets have been purchased (one submission can equal 1 to 10 tickets), not just on how many times the form itself has been submitted.

    One thing I'm somewhat disappointed in (but could be wrong about) is that there doesn't seem to be a way to have Gravity Forms give you information about the elements in a form such as the ID or position/index of an element based on the form element's name. I had to write some custom functions for that and I'm not sure they're the most efficient/elegant way to do this.

    In any case, GravityForms rocks!

    Posted 11 years ago on Tuesday April 30, 2013 | Permalink

This topic has been resolved and has been closed to new replies.