When facets leave only one product, it gets rendered via single-product.php
- wpsolrKeymaster4 years, 10 months ago #14756
Can you debug in wp-content/plugins/wpsolr-pro/wpsolr/core/classes/services/class-wpsolr-service-container.php WPSOLR_Service_Container::get_is_replace_by_wpsolr_query() ?
Comment out the whole function content to replace it with “return true;” and see what happens.
leomoonParticipant4 years, 10 months ago #14757What happens is that instead of getting related products, I get all the products from a set, as if no filters are selected. If I select any of the filters with more than one product, it works fine. The problem is still when its filtered down to just one product.
mcl7Participant3 years, 9 months ago #22838I had this problem but I forgot that I had added some code previously that redirects the user to the product page if there was only one product. Make sure something like that isn’t in place. How does it behave with WPsolr off when you click on a category with one item in it?
leomoonParticipant3 years, 9 months ago #22846This was the solution in my case…
add_filter( ‘woocommerce_redirect_single_search_result’, ‘__return_false’ );
But still, if someone wants a product page to display in case of a single result, this plugin should handle that properly as well. If using faucets however, you don’t want that to happen.
You must be logged in to reply to this topic.