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

Add table summary to Customers Report #1385

Merged
merged 4 commits into from Jan 28, 2019

Conversation

2 participants
@jeffstieler
Copy link
Contributor

jeffstieler commented Jan 24, 2019

Fixes #918.

This PR seeks to add a table summary to the customers report, powered by a new /reports/customers/stats endpoint.

Screenshots

Design:
screen shot 2019-01-23 at 6 08 59 pm

As implemented:
screen shot 2019-01-23 at 6 11 25 pm

Detailed test instructions:

  • Open Customers Report
  • Verify that the summary displays
  • Verify that the totals change (and are correct) when adding filters to the report

Note: the aggregate values are calculated only for customers that have placed orders. If your report contains 10 customers, but only 4 have placed orders, the summary totals will be based on those 4 customers, not all 10.

@psealock
Copy link
Collaborator

psealock left a comment

I only got halfway through this before having to stop until later, but looking good at first glance.

$args['last_order_before'] = $request['last_order_before'];
$args['last_order_after'] = $request['last_order_after'];
$between_params = array( 'orders_count', 'total_spend', 'avg_order_value' );

This comment has been minimized.

@psealock

psealock Jan 24, 2019

Collaborator

last_active and registered are missing from this array. They are also missing in the /reports/customers endpoint. Perhaps a clue as to why thats not working

This comment has been minimized.

@psealock

psealock Jan 24, 2019

Collaborator

Created an issue to track separately here #1388

},
{
label: __( 'average orders', 'wc-admin' ),
value: numberFormat( totals.avg_orders_count ),

This comment has been minimized.

@psealock

psealock Jan 24, 2019

Collaborator

One decimal point is enough I think.

screen shot 2019-01-24 at 3 20 15 pm

@psealock
Copy link
Collaborator

psealock left a comment

LGTM and working as expected, besides the issue #1386 #1387 #1388 which are best dealt with separately.

@jeffstieler jeffstieler merged commit 998f2e9 into master Jan 28, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jeffstieler jeffstieler added this to 🥋Sprint 11 Done in Isotope via automation Jan 28, 2019

@jeffstieler jeffstieler deleted the add/customers-report-table-summary branch Jan 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment