Search results for ""

Sorry, no results found. Perhaps you would like to search the community forum?
All Topics
AMPERAGE Marketing & Fundraising

WooCommerce Order Filtering Doesn't Update Pagination Properly

Product, coupon, etc. filtering appears to be working just fine. However, I used a filter on the WooCommerce => Orders page (which is the more important view to have filterable for our purposes) to then see the filtered results, but the total item count and pagination isn’t updating properly. Also, some filters show just 1 result on the first page, and then going to the next page has it show another result.

So it appears there might be two issues here:

  • Filtering WooCommerce => Orders doesn’t have pagination & item count update properly.
  • Filtering WooCommerce => Orders doesn’t properly pull all of the results onto as few pages as possible.

I’ve tried using a few different filters to see if one behaves better than others (just search for if a column contains certain text, orders from a specific date, orders above a certain total, etc.), but it appears they all seem to be suffering from this issue. I also looked into this on a few other WooCommerce sites, and it appears this isn’t isolated to one site.

Meanwhile, I can say that doing a basic text-based search via the search input on the Orders page has things filter properly.

Here’s a screenshot showing how only 4 results are showing (there should be more results than that) when it should show 100 per page, and the pagination & items haven’t been updated to reflect the search results whatsoever (still showing the total items & all pages as if it hasn’t been filtered).

1 week ago
AMPERAGE Marketing & Fundraising

Okay, I found another site where it is filtering properly even though much of the setup & plugins being used is the same. Odd.

1 week ago
AMPERAGE Marketing & Fundraising

Using Query Monitor, I found that `
AND wp_posts.ID IN (1534933,1534930,1534907,1534899,1534886,1534877,1534867,1534864,1534862,1534860)` is being added to the main query for some reason on the site having issues. Meanwhile the site without issues doesn’t have this (or similar) present at all when both are just being told to do a filter of orders after a certain date… nothing else.

Also, ORDER BY wp_posts.post_date DESC appears to be changed to ORDER BY FIELD(wp_posts.ID,1534933,1534930,1534907,1534899,1534886,1534877,1534867,1534864,1534862,1534860) at the later end of the query on the problematic site.

Why are IDs being provided at all in the query? I’m thinking this is causing the issue being experienced here on a few sites (looks to be a key difference between a site that filters orders by date [and other things] without issue and one that is having problems).

1 week ago
AMPERAGE Marketing & Fundraising

It also appears to oddly change LIMIT 0, 100 in that query (per my Screen Options having 100 orders to a page) to instead be LIMIT 0, 10 when the filtering problem occurs (alongside the IDs being specified in the database query which were never specified from the site admin at any point [again, just went to Orders and said to filter by everything after a certain date… that’s it.])

1 week ago
AMPERAGE Marketing & Fundraising

Update! It appears that disabling the “WooCommerce Order Search Admin” plugin (in the official plugin repository) was the key to resolving this issue.

I will report this problem to the developer of the WooCommerce Order Search Admin plugin to see if they can get this resolved in a future update (leaving it as deactivated for now).

1 week ago

Thanks for the detailed error report.
We try to write your filters as clean as possible allowing others to hook into the WP_Query as well.
But of course, it’s always possible that multiple alternations on the WP_Query can lead to unexpected behavior.
Please let me know if you have an answer from the developers of WC Order Search Admin and if there’s anything else we can do. I will close this ticket for now.

6 days, 16 hours ago
AMPERAGE Marketing & Fundraising

Per my support topic for their plugin in the official WP plugin repository, I learned that they allow for the backend search (which is what is altering the WP_Query) to be disabled via the following code:

function should_enable_algolia_woocommerce_backend_search( $value, WP_Query $query ) {
    return false;
add_filter( 'wc_osa_enable_backend_search', 'should_enable_algolia_woocommerce_backend_search', 10, 2 );

So it appears both plugins can be used without issue by adding this code snippet to the theme’s functions.php file (which I’ve done & confirmed works.)

6 days, 4 hours ago

Thanks for letting us know!
I’ll keep this in mind for any future support questions related to ‘WooCommerce Order Search Admin’.

4 days, 16 hours ago

You must be logged in to reply to this topic.