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

Remove unnecessary order adjustment for WC queries #2577

Merged
merged 2 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,20 @@ ElasticPress has an in depth documentation site. [Visit the docs ☞](http://10u

ElasticPress FAQs and tutorials can be found on our support site. [Visit the support site ☞](https://elasticpress.zendesk.com/hc/en-us)

## Requirements
## Requirements and Compatibility

### Requirements

ElasticPress requires these software with the following versions:

* [Elasticsearch](https://www.elastic.co) 5.0+ **ElasticSearch max version supported: 7.9**
* [WordPress](http://wordpress.org) 3.7.1+
* [PHP](https://php.net/) 5.6+

### Compatibility

The WooCommerce feature is compatible with the last two major versions of the [WooCommerce plugin](https://wordpress.org/plugins/woocommerce/).

## React Components

Interested in integrating ElasticPress in your headless WordPress website? Check out [ElasticPress React](https://github.com/10up/elasticpress-react).
Expand Down
10 changes: 0 additions & 10 deletions includes/classes/Feature/WooCommerce/WooCommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,16 +373,6 @@ public function translate_args( $query ) {
$query->query['ep_integrate'] = true;

if ( ! empty( $s ) ) {
$query->set( 'orderby', false ); // Just order by relevance.

/**
* Default order when doing search in Woocommerce is 'ASC'
* These lines will change it to 'DESC' as we want to most relevant result
*/
if ( empty( $_GET['orderby'] ) && $query->is_main_query() ) { // phpcs:ignore WordPress.Security.NonceVerification
$query->set( 'order', 'DESC' );
}

// Search query
if ( 'shop_order' === $post_type ) {
$default_search_fields = array( 'post_title', 'post_content', 'post_excerpt' );
Expand Down