-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce EDD_Stats class #1376
Comments
I might also suggest that we write a |
Debating on whether this should also allow sale data to be retrieved in the same way, as opposed to just sale stats. |
Yes. That would be insanely useful
|
If I do that, I want to rename it. Votes on what to name it? |
There should be 2 ones. One for statistics abd one called edd sales
|
I do like the idea of an EDD_Sales class that makes it easy to get sales data by date and also does all of the grunt work of retrieving sale meta. It should be able to get sales for the whole store AND specific products. |
…new instance in order to retrieve stats for different date ranges. #1376
Stats can now be retrieved like so: $stats = new EDD_Stats;
// Sales for this month:
echo $stats->get_sales( 0, 'this_month' );
// Earnings for August 2, 2013
echo $stats->get_earnings( 0, 'August 2, 2013' );
// Sales for download 44 from July 2 to August 5, 2013
echo $stats->get_sales( 44, 'July 2, 2013', 'August 5, 2013' ); The first parameter is the download ID to retrieve stats for, the second is the start date, and the third is the end date. Dates can be passed as date strings, predefined date ranges (last_year, this_week, etc), timestamps, and human readable dates. Predefined date options are:
|
🍪 |
We now have a |
The classes have been refactored a bit. There is now the $stats = new EDD_Payment_Stats;
// Sales for this month:
echo $stats->get_sales( 0, 'this_month' );
// Earnings for August 2, 2013
echo $stats->get_earnings( 0, 'August 2, 2013' );
// Sales for download 44 from July 2 to August 5, 2013
echo $stats->get_sales( 44, 'July 2, 2013', 'August 5, 2013' ); |
Why is |
Because they're not actually the same. The columns are referenced differently. |
Nevermind... nothing to see here... :P |
The |
The lifetime best selling function isn't working correctly. According to the live EDD site, PDF Invoices is the best selling extension: http://screencloud.net/v/rBXZ - while I know @sunnyratilal would love that to be true, it's not. |
Well in @sunnyratilal's mind there isn't anything wrong with that function. Maybe we could hardcode something like: |
We need to finally have a full stats API that allows us to:
We have some various functions for these but no full-fledged API.
This API should be used in Reports / Graphs, EDD_API class, and anywhere else that retrieves / shows stats.
The text was updated successfully, but these errors were encountered: