[Support request] Navigation Search by SKU

Home Forums Support Navigation Search by SKU

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

    I am using the code snippet below that I found in the forums to make the default nav search include products only. However, I cannot seem to search by SKU number. Is there something I can add to make this field use SKU as an additional WooCommerce searchable field.

    add_filter( 'generate_navigation_search_output', function() {
            '<form method="get" class="search-form navigation-search" action="%1$s">
                <input type="search" class="search-field" value="%2$s" name="s" title="%3$s" />
                <input type="hidden" name="post_type" value="product" />
            esc_url( home_url( '/' ) ), 
            esc_attr( get_search_query() ),   
            esc_attr_x( 'Search', 'label', 'generatepress' ) 
    } );


    Lead Developer
    Lead Developer
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.