I'm posting as my last option because I've searched and tried different hooks and code and I can't seem to get this to work. I'm using GF with WooCommerce to process a form.
All I want to do is to have Customer A place an order (without payment). Customer B will then go on, enter the order number to find out the cost, then go on to payment.
The last thing I tried is using the below code in the functions.php file but no luck:
[php]
add_filter('gform_field_value_cst', 'populate_order_fee');
function populate_order_fee($value){
global $post;
global $wpdb;
$order_ID = $wpdb->get_var("SELECT post_id FROM database_table WHERE meta_value = '$_POST[ord];'");
$order_total = $wpdb->get_var("SELECT meta_value FROM database_table WHERE post_id = $order_ID AND meta_key = '_order_total'");
return $order_total;
}
"cst" is the parameter name for the field that needs $order_total.
Am I totally going about this the wrong way? Can GF even do this type of thing?
Basically I want to fill out the first field of a 1 field form -> run a mysql query to find the $order_total -> populate the second second field -> then go to payment.
Thanks in advance for any help.