Feature: Add WooCommerce HPOS compatibility for orders - #4038
Open
felipeelia wants to merge 60 commits into
Open
Feature: Add WooCommerce HPOS compatibility for orders#4038felipeelia wants to merge 60 commits into
felipeelia wants to merge 60 commits into
Conversation
1 task
burhandodhy
force-pushed
the
feature/wc-hpos-issue-3476
branch
from
February 12, 2026 08:12
ce29915 to
9d558a0
Compare
burhandodhy
force-pushed
the
feature/wc-hpos-issue-3476
branch
from
February 19, 2026 07:46
2317e7e to
da0040e
Compare
Tax-adjusted min/max price bounds can drift past the indexed value (e.g. 100.99000000000001), excluding products at the filter edge. Format via wc_format_decimal to match WooCommerce core precision.
There was a problem hiding this comment.
Pull request overview
Adds WooCommerce HPOS order indexing and Elasticsearch-backed order queries for WooCommerce 9.8+.
Changes:
- Adds HPOS indexing, query translation, notices, and settings.
- Extends order autosuggest compatibility.
- Adds PHP/E2E coverage and updates minimum test versions.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/playwright.yml |
Updates minimum WP/WooCommerce versions. |
composer.lock |
Upgrades WooCommerce test dependency. |
includes/classes/Feature/WooCommerce/Orders.php |
Integrates HPOS settings and lifecycle. |
includes/classes/Feature/WooCommerce/OrdersAutosuggest.php |
Adds HPOS autosuggest compatibility. |
includes/classes/Feature/WooCommerce/OrdersHPOS.php |
Implements HPOS indexing and interception. |
includes/classes/Feature/WooCommerce/OrdersHPOSQuery.php |
Translates HPOS queries for Elasticsearch. |
includes/classes/Feature/WooCommerce/Products.php |
Formats tax-adjusted prices. |
includes/classes/Feature/WooCommerce/WooCommerce.php |
Adds the HPOS setting default. |
tests/e2e/src/block-editor.ts |
Updates editor compatibility helpers. |
tests/e2e/src/specs/general.spec.ts |
Updates WP 6.4 selector handling. |
tests/e2e/src/specs/related-posts.spec.ts |
Updates WP 6.4 editor behavior. |
tests/e2e/src/specs/woocommerce.spec.ts |
Adds HPOS order and autosuggest flows. |
tests/e2e/src/utils.ts |
Updates WP 6.4 utility branches. |
tests/php/bootstrap.php |
Installs HPOS database tables. |
tests/php/features/WooCommerce/TestWooCommerce.php |
Verifies the new setting schema. |
tests/php/features/WooCommerce/TestWooCommerceOrders.php |
Adds extensive HPOS query tests. |
tests/php/features/WooCommerce/TestWooCommerceOrdersAutosuggest.php |
Tests HPOS autosuggest availability. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 19 changed files in this pull request and generated no new comments.
Suppressed comments (4)
includes/classes/Feature/WooCommerce/OrdersHPOSQuery.php:845
- In
build_customer_meta_clause(), the meta_query for_customer_userusescompare => '='whilevalueis an array of IDs.WP_Meta_QueryexpectsIN/NOT INwhenvalueis an array; using=here can lead to customer ID filtering not working (including for nested[ id, email ]cases where$idsstill becomes an array).
'key' => '_customer_user',
'value' => $ids,
'compare' => '=',
'type' => 'NUMERIC',
];
includes/classes/Feature/WooCommerce/OrdersHPOSQuery.php:853
- Similarly, the
_billing_emailcustomer clause usescompare => '='with an array of emails. This should useINto behave correctly when multiple emails are provided.
$clauses[] = [
'key' => '_billing_email',
'value' => $emails,
'compare' => '=',
];
includes/classes/Feature/WooCommerce/Orders.php:361
- Typo in the docblock: “ElasticPres” should be “ElasticPress”.
* Display a notice when HPOS order queries are not integrated with ElasticPres.
includes/classes/Feature/WooCommerce/Products.php:202
get_price_filter_tax_adjustment()is documented to return a float and is used to populate numeric Elasticsearch range bounds, butwc_format_decimal()returns a string. Casting back to float keeps the return type consistent and avoids subtle type/empty() edge cases.
return wc_format_decimal( $price - \WC_Tax::get_tax_total( \WC_Tax::calc_inclusive_tax( $price, $tax_rates ) ) );
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of the Change
Adds ElasticPress support for WooCommerce High-performance order storage (HPOS) on the admin Orders list.
When HPOS is enabled and WooCommerce is 9.8.0 or greater, ElasticPress now:
woocommerce_hpos_pre_queryOrdersHPOS/OrdersHPOSQuery)Compatibility details:
ep_woocommerce_hpos_min_version)Closes #3476
How to test the Change
wp wc hpos enable), enable WooCommerce + Protected Content, and sync.admin.php?page=wc-orders) and confirm list search/filters go through Elasticsearch.Changelog Entry
Credits
Props @felipeelia @burhandodhy
Checklist: