Home Forums WoodMart support forum Woodmart search form

Woodmart search form

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

    Eris Webmaster
    Participant

    Hello,
    In the Woodmart search form (header search with category dropdown), I want to show only parent product categories (hide subcategories) and hide empty categories.
    I tried using the following hooks, but none of them had any effect:
    • woocommerce_product_categories_dropdown_args
    • woodmart_get_categories_for_search
    • woodmart_search_categories_list

    It appears that the search dropdown loads categories from a custom template or an AJAX function that bypasses these filters.
    Can you guide me on how to filter/override the category list for the search select? Or which hook/template should I modify safely?

    Thank you!
    Kind Regards
    Erik

    Attachments:
    You must be logged in to view attached files.
    #694534

    Hello,

    If you want to hide the sub-categories from the search drop-down, try using this Custom CSS code.

    .wd-dropdown-search-cat .children li a {
        display: none;
    }

    Otherwise, you need to edit the theme files for this. All the customizations made in the theme files are at your own risk.
    inc/modules/search/class-ajax-search.php

    Best Regards,

Tagged: 

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