-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Add new filter to add additional clauses for SQL statement in Variations report #36378
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…se' filter to apply sql clauses directly
Contributor
Test Results SummaryCommit SHA: cafd7a2
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
… because the assignment was outside the 'else' statement
AnnaMag
approved these changes
Jan 19, 2023
Contributor
AnnaMag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks @nathanss.
adrianduffell
pushed a commit
that referenced
this pull request
Jan 20, 2023
…ons report (#36378) * Apply filter to get additional sql to include variations with no orders * Add join only when correct option is selected * Some more desperate tests * Analytics: use a sepoarate query for data without orders. * Change 'experimental_woocommerce_analytics_variations_additional_clause' filter to apply sql clauses directly * Cleanup * Add changelog * Fix PHPCS issues * Add docblock and update the filter name * Improve docblock of new filter * Add Since 7.4.0 on filter * Move union statement before order by statement * Apply filters before running the db count statement and add sql select clause before * Remove with sql clause since it's not compatible with MySQL 5.7 * Remove additional spaces * Fix bug caught by unit test in which $variations_query is overwritten because the assignment was outside the 'else' statement Co-authored-by: AnnaMag <[email protected]>
vedanshujain
pushed a commit
that referenced
this pull request
Jan 25, 2023
…ons report (#36378) * Apply filter to get additional sql to include variations with no orders * Add join only when correct option is selected * Some more desperate tests * Analytics: use a sepoarate query for data without orders. * Change 'experimental_woocommerce_analytics_variations_additional_clause' filter to apply sql clauses directly * Cleanup * Add changelog * Fix PHPCS issues * Add docblock and update the filter name * Improve docblock of new filter * Add Since 7.4.0 on filter * Move union statement before order by statement * Apply filters before running the db count statement and add sql select clause before * Remove with sql clause since it's not compatible with MySQL 5.7 * Remove additional spaces * Fix bug caught by unit test in which $variations_query is overwritten because the assignment was outside the 'else' statement Co-authored-by: AnnaMag <[email protected]>
Contributor
|
The The code should be: $query_args = apply_filters( 'experimental_woocommerce_analytics_variations_additional_clauses', $query_args, $this->subquery ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
plugin: woocommerce
Issues related to the WooCommerce Core plugin.
Reports/Analytics
Issues related to analytics section.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All Submissions:
Changes proposed in this Pull Request:
Add new filter to add additional clauses for SQL statement in Variations report
This should allow extensions to customize the results from the query.
How to test the changes in this Pull Request:
There's a private extension in development to test that: check https://github.com/Automattic/swag-store-custom-analytics/pull/2
Other information:
pnpm --filter=<project> changelog add?FOR PR REVIEWER ONLY: