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?