Fix SearchWP and Woocomerce integration for default search page

<?php
// Temporary fix for products not appearing on the default product search results page (the page with /?s=searchterm&post_type=product in the URL).
// The issue happens when using FacetWP, SearchWP, and the SearchWP WooCommerce Integration add-on together.
// Also see: https://facetwp.com/help-center/using-facetwp-with/searchwp/#fix-searchwp-and-woocomerce-integration-on-the-default-search-page

add_filter( 'facetwp_is_main_query', function( $is_main_query, $query ) {
    if ( $is_main_query && $query->is_main_query() && $query->is_search() ) {
        if ( true == $query->get( 'wc_query' ) ) {
            $query->set( 'using_searchwp', '' );
        }        
    }
    return $is_main_query;
}, 11, 2);