Hi Experts,
I bought the Ultimeter plugin to show donation progress in a nice visual manner. Working with developer he gave me the add filter to make his plugin pull data from my two donation forms but he is not that familiar with gravity forms and the data is not pulling exactly right. He told me to reach out to you for help with this. The function is asking for the grand total with a start amount at “0”. But where is the start amount coming from because if I add up the last month, this year or last year, nothing matches what the filter is pulling. Like I said, the developer is not sure he has anything right so if you have a better way to set this up, I will be most appreciated.
Testing page is: https://standupgirlfoundation.org/ultimeter-test/
Form is live and hooked up to Stripe.
Thank you looking at this for me!
Diana
Here is the code he tried:
/*progress total in ultimeter plugin*/
add_filter('ultimeter_filter_currency_progress', 'gravity');
function gravity( $grandtotal ) {
// Create array of the both my form IDs
$forms = array(67,68);
// Declare an empty variable for the grand total
$grandtotal = 0;
// Loop through each form to get its leads
foreach ($forms as $form) {
$donations = RGFormsModel::get_leads($form);
// start the total at zero
$total = 0;
// loop through all the returned results
foreach ($donations as $amount) {
// add each donation amount to the total
// field ID 4 for both my forms which holds the donation amount
$total += $amount[4];
}
// Add the form's total to the grand total
$grandtotal += $total;
}
// Finally, return the grand total
return $grandtotal;
}