Hi there, a configurator of ours recently stopped working like it should after updating gravity forms. I have a product options field (with prices) that is dynamically populated by a filter. It all works well except for when you select the options on the front end, the total does not update at all, it does register the price when you submit the form but it does not show the user what the real time total is.
Before the update i had no problems with this, it would just update the price in real time, any ideas on how to solve this, or maybe as a work around, how do i recalculate the total price with javascript/jquery after a checkbox is changed?
Here is my code:
add_filter( 'gform_pre_render_9', 'populate_posts2' );
add_filter( 'gform_pre_validation_9', 'populate_posts2' );
add_filter( 'gform_pre_submission_filter_9', 'populate_posts2' );
add_filter( 'gform_admin_pre_render_9', 'populate_posts2' );
function populate_posts2( $form ) {
if(!is_admin()){
foreach( $form['fields'] as $field ) {
$field_id = 3;
if ( $field->id != $field_id ) {
continue;
}
if( have_rows('configureerbare_opties') ):
while( have_rows('configureerbare_opties') ) : the_row();
$opties[get_sub_field('titel')] = get_sub_field('prijs');
endwhile;
endif;
foreach ($opties as $key => $value) {
if ($opties[$key] != ''){
$choices[] = array( 'text' => $key, 'value' => 12, 'price' => $opties[$key]);
}
}
$field->choices = $choices;
}
}
return $form;
}