-
Notifications
You must be signed in to change notification settings - Fork 312
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
Allow searches for variation SKU in admin interface #1828
Conversation
Just a random ping in the hopes of some sort of response :-) @dinhtungdu @jeffpaul Is the initial approach still valid in your opinion? I'm currently running with this PR on a couple of live sites |
@oscarssanchez can you test this one? |
Hi @kallehauge, I'm sorry for this late reply! Here is the result of my test. I tested your PR with WP 5.5.1 and WC 4.5.2. The Protected Content feature is enabled and posts are reindexed before testing. The product search "works", but there is a problem: the formatted args is not correct, it doesn't include Trace down the code I realize that WC uses a method named Can you confirm this behavior @kallehauge? cc @tlovett1. |
Hi @dinhtungdu, |
We need to determine the current behavior of searching for a product variation SKU with ElasticPress active. Currently, WooCommerce does not perform a search query to retrieve these results, it does a direct SQL database query. If the search field fails to find parent products of a variation SKU with EP enabled, we need to figure out either how to disable this EP integration or short circuit the entire WC "search routine." |
Description of the Change
This is a proof of concept of handling searching by products variations SKU and returning parent product (#781) and is a refactored version of #941 since it got closed due to major code changes in 3.0.
The point of this is to be able to search for a variation sku and then get the parent product in the admin interface (this is a default feature in WooCommerce).
Verification Process
I created a new variable product with a couple of variants. These all have a new
__wc_ep_variations_skus
meta value in Elasticsearch.The value of
__wc_ep_variations_skus
is being updated when the parent product is updating which is the core logic of the PR but the value have also been tested to update when a variation is being deleted through the admin interface without pressing the "Update" button for the parent product and the value have also been tested to update when using the variation Save Changes button below variations in the interface (hence; not the "Update parent post button")I have also tested that the admin product overview list changes only affect the mentioned list by test other overview lists (like Orders, Pages, Posts) and on the front-end when Elasticsearch is enabled.
Checklist:
Applicable Issues
#781
Changelog Entry
WC Enhancement: add variation sku as a searchable field and apply it on the product overview list.