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.

Formatting to prepopulate price?

  1. I can't seem to prepopulate a product option box

    The code works for pulling the value into a simple text field, but won't work on a product option field?

    add_filter('gform_pre_render_21', 'GF_update_trip_info1');
    function GF_update_trip_info1 ($form) {
    
        foreach ($form['fields'] as &$field) {
    
    	if($field["id"] == 20){
    		$field["defaultValue"] = get_post_meta(2, 'your_trips_0_full_cost', true);
    	}
    	if($field["id"] == 19){
    		$field["defaultValue"] = get_post_meta(2, 'your_trips_0_full_cost', true);
    	}
    
    } return $form;
    }

    Field 20 is a text box and 19 is product option, it is pulling the same value but won't appear in the price box. I am using the WooCommerce grav add-on, could this be blocking price fields from being populated?

    Posted 12 years ago on Friday September 21, 2012 | Permalink
  2. Apparently this is some kind of minor bug, judging by

    http://www.gravityhelp.com/forums/topic/dynamic-populate-fields

    and

    http://www.gravityhelp.com/forums/topic/dynamic-population-of-pricing-option-fields

    How can I get this solution?

    Posted 12 years ago on Friday September 21, 2012 | Permalink
  3. The bug mentioned in those posts was fixed a long time ago. Can you post a link to your site please so we can see what's going on? Thank you.

    Posted 12 years ago on Monday September 24, 2012 | Permalink
  4. Sure, the example form can be seen on hookahi.com/example . I tried with id 19.1 too for the checkbox, neither worked

    Posted 12 years ago on Monday September 24, 2012 | Permalink
  5. Chris, were you able to tell what's wrong?

    Posted 12 years ago on Tuesday September 25, 2012 | Permalink