Home Forums WoodMart support forum Problem with product filters with

Problem with product filters with

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #240463

    neuro
    Participant

    Hello,

    Congradulations for your excellent work.

    I have a problem with filters if i change that search query to include specific products.

    I am using a function like

    function neuro_search_filter( $query ) {
    if ( $query->is_search && $query->is_main_query() ) {
    $query->set( ‘post__in’, array( 1477, 1487 ) );
    }
    }

    add_action( ‘pre_get_posts’, ‘neuro_search_filter’ );

    Where i say to say to search query to include only posts 1477, 1487 in search results regardless what is searched. If i do so, search results are OK, include only those 2 products, but sidebar filters include all posible values and not all available to the 2 products as it would be if i did a normal search.

    Is there any other place i can put my code in order to display disired results but have the filters working also?

    Thank you.

    #240474

    Artem Temos
    Keymaster

    Hello,

    Sorry, but this question is beyond our support limits. You are trying to customize the standard WooCommerce functionality and we don’t have instructions for this.

    Kind Regards

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)