Help With Gravity Forms Input Fields (3 posts)

  1. barryanders
    Posted 2 years ago #

    Gravity Forms Product Add-ons displays the form inputs in the cart and checkout. I want to display these form fields in the user's Account page with their orders. I've been trying for a couple days and can't seem to get the right php code put together. How can I do this? Maybe it's easier than I realize. I've tried copying many things from the "gravityforms-product-addons.php" file, but no luck so far.

    I just have one field for each product that I need to display the user's input from. Obviously, Woocommerce already displays the title of products, so I don't need help with that. Just figuring out how to call the form's field.


  2. barryanders
    Posted 2 years ago #

    I've made significant progress, but I still need a little help.

    My code as it stands is like so:

    $form_id = RGFormsModel::get_form_id('Domains');
    $form = GFFormsModel::get_form_meta($form_id);
    $field = GFFormsModel::get_field($form, 1);
    $leads = RGFormsModel::get_leads($form['id']);
    foreach($leads as $lead)
        foreach($field as $field_id)
            $value = rgar($lead, (string) $field_id);
            echo $value;

    This returns all entries for the field I want, however, I only want to return the entry that was submitted with that particular product. Help?

  3. d0cpaul
    Posted 2 years ago #

    Hey I was wondering if you figured this out? I used your code but two entries omitted instead of one. Good work so far!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic