Skip to content
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

Average order value graph does not display any data #7852

Merged
merged 3 commits into from May 8, 2015
Merged

Average order value graph does not display any data #7852

merged 3 commits into from May 8, 2015

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented May 7, 2015

fixes #7851

There were 2 problems:

  • avg_order_revenue depends on revenue and conversion_rate but when selecting avg_order_revenue only that metric was fetched, the dependent ones were not fetched
  • avg_order_revenue was formatted eg to $ 12.04 which resulted in 0 when converting to float.

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels May 7, 2015
@tsteur tsteur added this to the 2.14.0 milestone May 7, 2015
$metricsToAdd = $avgOrder->getDependentMetrics();
$requestedColumns = array_unique(array_merge($requestedColumns, $metricsToAdd));
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic should be handled by the Report::getMetricsRequiredForReport() call below, is there a reason it isn't?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind I see my comment below about this.

@diosmosis
Copy link
Member

Should there be a new test for this? Existing tests don't change, so I assume this code path isn't being tested.

@tsteur
Copy link
Member Author

tsteur commented May 7, 2015

Added a test

@diosmosis diosmosis removed the Needs Review PRs that need a code review label May 8, 2015
diosmosis added a commit that referenced this pull request May 8, 2015
Fixes #7851, fix average order value graph does not display any data. If average_order_value is requested by itself, dependent metrics are not requested as well because logic is done manually in API method, not in Report infrastructure.
@diosmosis diosmosis merged commit a37bafb into master May 8, 2015
@diosmosis diosmosis deleted the 7851 branch May 8, 2015 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants