Update product filters when using custom query
-
Hi,
I am using
woof_products_query
to modify the products displayed on my ‘author’ page, so it shows only products by that author.Working
function woof_modify_query( $query ) { // Check we're on a /shop page before filtering the product query. if( dokan_is_store_page() ) { $store_user = dokan()->vendor->get( get_query_var( 'author' ) ); $query['author'] = $store_user->id; return $query; } } add_action( 'woof_products_query', __NAMESPACE__.'\\woof_modify_query' );
It changes what products are displayed, but it does not affect the product filters. In this image, you can see there are “Showing 23 items”, and yet the Categories are still showing how many products are available across the whole site. Do you understand what I mean? I’ve included screenshots.
Image #1
https://ibb.co/D9kmcbzImage #2
https://ibb.co/7v0WN63
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Update product filters when using custom query’ is closed to new replies.