Custom query not updating total value when transaction is removed
-
Hello,
First off, thanks for a killer product. It’s been awesome working with it.
Onto this situation that has been perplexing me a bit today. We wrote a small snippet of code to display the total aggregated amount of all donations for the year. It by all accounts works and has displayed the demo transactions fine. When we went into to delete those fictitious transactions, the total value still remains the total sum ever completed, but not the current amount if that makes sense. Any insight or help would be greatly appreciated!
Thanks,
TonySnippet:
<?php $output = '<div class="goal-progress">'; $stats = new Give_Payment_Stats; $earnings_today = $stats->get_earnings( 0, 'this_year', false ); //Goal Progress Text $output .= '<div class="raisedHome">'; $output .= sprintf( _x( '%s of %s raised', 'This text displays the amount of income raised compared to the goal.', 'give' ), '<span class="incomeHome">' . give_currency_filter( give_format_amount( $earnings_today ) ) . '</span>', '<span class="goal-textHome">$100,000</span>'); $output .= '</div>'; //Goal Progress Bar $progress = round(($earnings_today / 100000) * 100); $color = '#003e7e'; $output .= '<div class="progress-bar">'; $output .= '<span style="width: ' . esc_attr( $progress ) . '%;'; if ( ! empty( $color ) ) { $output .= 'background-color:' . $color; } $output .= '"></span>'; $output .= '</div><!-- /.progress-bar -->'; $output .= '</div><!-- /.goal-progress -->'; echo $output; ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom query not updating total value when transaction is removed’ is closed to new replies.