This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'gravityflow_post_webhook', 'sh_action_gravityflow_post_webhook', 10, 4 ); | |
function sh_action_gravityflow_post_webhook( $response, $args, $entry, $current_step ) { | |
//Replace step ID and fields for calculation to match your use case. | |
if ( $current_step->get_id() == 77 && is_numeric( $entry['3'] ) && is_numeric( $entry['16'] ) ) { | |
$entry['14'] = round( $entry['3'] * $entry['16'], 2); | |
$result = GFAPI::update_entry( $entry ); | |
} | |
} |