Skip to content

Instantly share code, notes, and snippets.

@johnchandler
Created August 6, 2013 23:02
Show Gist options
  • Save johnchandler/6169632 to your computer and use it in GitHub Desktop.
Save johnchandler/6169632 to your computer and use it in GitHub Desktop.
// Determine SAT Cost Depending on School
add_filter('gform_pre_render_2', 'define_sat_cost');
function define_sat_cost($form){
//Get current form page
$current_page = GFFormDisplay::get_current_page($form["id"]);
//If the current form page is page 2
if ($current_page == 2) {
$school = $_POST["input_6"];
if ( $school == "Bayside High" ) :
$_POST["input_19_2"] = 499;
elseif ( $school == "San Dimas High" ) :
$_POST["input_19_2"] = 549;
else :
$_POST["input_19_2"] = 599; //default price
endif;
}
//Return the form
return $form;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment