[Support request] Add search in Product-Tag

Home Forums Support [Support request] Add search in Product-Tag

Home Forums Support Add search in Product-Tag

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

    Hello,
    How are you?
    I just want to add the possibility to search for products that contain a specific product tag.
    I have seen this code in the documentation:
    add_filter( ‘generate_navigation_search_output’, function() {
    printf(
    ‘<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” />
    </form>’,
    esc_url( home_url( ‘/’ ) ),
    esc_attr( get_search_query() ),
    esc_attr_x( ‘Search’, ‘label’, ‘generatepress’ )
    );
    } );

    but I think is for limiting the standard WordPress search to only products.

    I found a solution by using the plugin WP Extended Search https://wordpress.org/plugins/wp-extended-search/ It adds a search for Select Taxonomies (e.g product_tag) but I would like to avoid using many plugins.

    How can I add the product-tag search in the previous code?
    Thank you very much for your help.
    Kind regards,

    #1588197
    David
    Staff
    Customer Support

    Hi there,

    the default WP Search function which is what the GP Nav uses doesn’t support that level of functionality. Aside of custom development you will need a plugin. Maybe this Woo specific search from which supports Search Terms would be a better fit:

    https://en-gb.wordpress.org/plugins/advanced-woo-search/

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