• Hi there!
    I use woodmart theme for my shop which comes along with an ajax search in the header, where you can search for products, posts and pages (option “all post types” for this kind of search). Unfortunatelly, this ajax search shows pages hidden by searchexclude in the results. I got a snippet (add_filter function) from the woodmart support team to hide hidden products from this search:

    add_filter( 'woodmart_ajax_search_args', function ( $args, $post_type ) {
    $args['tax_query'][] = array(
    'taxonomy' => 'product_visibility',
    'field' => 'name',
    'terms' => ['exclude-from-catalog', 'exclude-from-search'],
    'operator' => 'NOT IN',
    );

    return $args;
    }, 10, 2 );

    Now I need an addidtional query to be able to exclude hidden pages. Something like this:

    add_filter( 'woodmart_ajax_search_args', function ( $args, $post_type ) {
    $args['tax_query'][] = array(
    array(
    'relation' => 'OR',
    array(
    'taxonomy' => 'product_visibility',
    'field' => 'name',
    'terms' => ['exclude-from-catalog', 'exclude-from-search'],
    'operator' => 'NOT IN',
    ),
    array (
    // what comes here to exlude hidden pages?
    ),
    );

    return $args;
    }, 10, 2 );

    May you please help me with this problem? Woodmart support ends here because this topic concerns a third party plugin…

    Thank’s a lot and best regards,
    Kerstin

Viewing 1 replies (of 1 total)
  • Plugin Support jmatiasmastro

    (@jmatiasmastro)

    We want to inform you that we have escalated your reports to our development team to investigate what is happening with the live search across different theme.

    Our team is currently analyzing the issue, and we will provide updates as soon as we have more information.

    Best regards.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.