Home Forums WoodMart support forum Extending Search Functionality: Including Categories in Search Results

Extending Search Functionality: Including Categories in Search Results

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #631073

    norborov
    Participant

    Hello,

    I am using the WoodMart theme on my website and have encountered the following issue when configuring the search:

    Currently, the search settings only allow displaying results for Products and Posts/Pages/Blog. However, important information on my site is also contained within the descriptions of product categories (Product Categories). I would like the search results to include categories if the search query matches text in a category description.

    For example:

    If a user searches for “red wooden chairs,” the search should find not only products with that description but also the “Wooden Chairs” category if its description contains the words “red” or “wooden.”
    My questions are:

    Does the WoodMart theme have a built-in option to include categories in search results?
    If such an option exists, how can I configure it?
    If this functionality is not available out of the box, are there any recommendations for adding this functionality using hooks, filters, or custom code (e.g., using pre_get_posts or similar)? Perhaps you could provide a code example or a link to documentation.

    Thanks

    #631112

    Artem Temos
    Keymaster

    Hello,

    There is no such option in our theme at the moment. But we are going to improve our search in the future updates and will consider this as a feature request as well.

    Kind Regards

    #631143

    norborov
    Participant

    It’s great that you will be working on this in future versions.
    However, I absolutely need this functionality at this stage.
    If necessary, I can modify the code myself, just give me some direction on where to start.

    #631187

    norborov
    Participant

    I think to use that filter $query_args = apply_filters( ‘woodmart_ajax_search_args’, $query_args, $post_type ) and then use relevanssi_do_query

    #631192

    Artem Temos
    Keymaster

    Hello,

    Sorry, but we don’t have instructions on such customizations.

    Kind Regards

Tagged: 

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