Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Plugins used: Gravity Forms Product Add-ons and Woocommerce

When adding a product to the cart that has a Gravity Form attached to it, it displays the entries from the form in the checkout. So for example, if the product was a shirt and the user typed in Large, then the cart would show "Size: Large". This carries over to the checkout page with the same text.

I need to display that same text in the user Account Page with their order after they purchase it. I have to use Gravity Forms rather than product variations because I need the user to be able to type in their answer rather than select it from a drop down menu.

I've been trying for a while and I have some code, but I think I'm headed in the wrong direction. Can anyone help me?

Here's the code I have so far, which returns every entry for the field I want from every user. Again, like I said, I think this is not the right direction, but I'm not really sure how else to go about it.

$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;
    }
}

I even got desperate and tried to create a session variable from within the gravityforms-product-addons.php file. That didn't work either.

share|improve this question

put on hold as off-topic by mrwweb, Mark Kaplun, Pieter Goosen, G. M., Johannes Pille yesterday

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – mrwweb, Mark Kaplun, Pieter Goosen, G. M., Johannes Pille
If this question can be reworded to fit the rules in the help center, please edit the question.

    
Answered over on this page... stackoverflow.com/questions/18879478/… –  Dotless Feb 18 at 21:53