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.

Dynamically Populate 3rd Party Form From Gravity Form Submission

  1. So I have read many posts about dynamically populating fields from GForm to GForm, but I am trying to transfer values from a GForm to a WooCommerce checkout form.

    I have done this:
    http://www.gravityhelp.com/documentation/page/File:Form-settings-confirmation-redirect.png

    which gets me the values passed from the first page with the gravity form to the WooCommerce checkout page. Now I need the WooCommerce fields to grab the values.

    I made a simple edit to the woocomerce form array so that I can use a hooked in filter like this:

    // Hook in
    add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );
    
    // hooked in function - $fields is passed via the filter
    function custom_override_checkout_fields( $fields ) {
         $fields['billing']['billing_email']['value'] = $value;
    
         return $fields;
    }

    So, I have data passed via a query string, a function hook, which can post data to the 2nd form... now how can I link the two? I feel like I'm close, but I could be miles away.

    Is it possible instead to save out a session variable such as:

    $_POST['email_address'];

    I could use that in the hook filter for woocommerce.

    Any help would be HUGELY appreciated! Thanks!

    Posted 11 years ago on Wednesday February 13, 2013 | Permalink
  2. If you pass the data in the query string, the parameters will be available in the $_GET global, like this:

    $_GET['email_address'];

    Does that help? You need to set up the page where you are directing the query string to read those values from the $_GET array.

    Posted 11 years ago on Sunday February 17, 2013 | Permalink
  3. Perfect! Thats exactly what I needed.

    Thanks!

    Posted 11 years ago on Sunday February 17, 2013 | Permalink
  4. Thanks for the update. Glad that will work for you.

    Posted 11 years ago on Sunday February 17, 2013 | Permalink

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