-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fix Issue with intermediate parents status #2263
Fix Issue with intermediate parents status #2263
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/refactor-product-stats #2263 +/- ##
================================================================
Coverage 59.9% 60.0%
- Complexity 4178 4181 +3
================================================================
Files 457 457
Lines 17708 17721 +13
================================================================
+ Hits 10611 10627 +16
+ Misses 7097 7094 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Thanks for addressing the problem of status priority in different batches. I tested using a small set of products and the calculation looked great. 👍
Changes proposed in this Pull Request:
Follow-up of #2257.
Now that we're calculating product statuses in batches, it's possible for variations from the same parents to come in different batches. For example:
Batch 1: Variable 1 - Parent ID 1 - DISAPPROVED
Batch 2: Variable 2 - Parent ID 1 - APPROVED
This could impact the total count because variable products are grouped by their parents. So, in the previous example, we should only count 1 DISAPPROVED product instead of 1 DISAPPROVED + 1 APPROVED.
This PR addresses the issue by storing the latest status from the parent product, ensuring it can be used for the total calculation.
Detailed test instructions:
google-listings-and-ads/src/API/Google/Query/MerchantProductViewReportQuery.php
Lines 22 to 28 in d7ecd99
$this->where( 'product_view.offer_id', ['gla_VARIABLE_ID_1', 'gla_VARIABLE_ID_2'], 'IN' );
1
in this line:google-listings-and-ads/src/API/Google/MerchantReport.php
Line 68 in d7ecd99
GET wc/gla/mc/product-statistics/refresh
Changelog entry