Product query – Filter by Price – not working properly
-
Hi Oscar,
I’d like to report a potential bug in class-wcpbc-frontend-pricing.php, whereby on line 43 (add_filter( ‘the_posts’, array( __CLASS__, ‘remove_product_query_filters’ ) );), it runs a function that is removing the filter for filter_price_post_clauses before it gets a chance to do its thing.
The end result is the args don’t get filtered and the SQL query generated doesn’t join the postmeta table and query the applicable price meta value for the products, rather relying on the default query, using the min_price and max_price fields in wc_product_meta_lookup, which obviously isn’t accurate.
Could the solution here be to remove those filter further on from when “the_posts” fires? And what would the implications be for not removing it at all? I have been trying to trace the problem for the last hour and I’ve only come across this as being the cause just moments ago, so I haven’t delved into it at this time. I thought it would be better to report it to you anyway, potentially hoping for for an official fix.
Thank you for your time.
Best,
Dave
- The topic ‘Product query – Filter by Price – not working properly’ is closed to new replies.