WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Help With Gravity Forms Input Fields (3 posts)

  1. barryanders
    Member
    Posted 11 months 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.

    http://wordpress.org/plugins/woocommerce/

  2. barryanders
    Member
    Posted 11 months 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
    Member
    Posted 4 months 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!

Reply

You must log in to post.

About this Plugin

About this Topic