Home New Guten Forums WoodMart support forum How to show only parent categories in Woodmart search dropdown?

How to show only parent categories in Woodmart search dropdown?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #666587

    Hello XTemos team,

    I hope you’re doing well. I’m using the full screen search layout in the header, with AJAX search enabled and the product categories dropdown visible.

    The issue is that the dropdown currently displays all product categories, including subcategories, which makes it difficult to navigate on stores with many sections.

    I’ve seen that in your Megamarket demo, the search dropdown only shows top-level (parent) categories, which is exactly the behavior I’d like to achieve.

    I’ve carefully checked all available settings under:

    – Woodmart > Theme Settings

    – Search configuration in the Header Builder

    …but I couldn’t find any visual option to limit the dropdown to parent categories only.

    Could you please confirm:

    Is there a native way (without custom code) to make the search dropdown show only parent product categories, as in your Megamarket demo?

    If not, is using the woodmart_product_categories_dropdown_args filter (with ‘parent’ => 0) the officially recommended way to achieve this?

    Thank you very much in advance for your help. And congratulations on such an excellent theme.

    Best regards,

    #666655

    Luke Nielsen
    Keymaster

    Hello,

    Is there any chance that you could give me access to the dashboard area so I can check the settings there?

    Looking forward to collaborating with you!

    Kind Regards

    #666690

    Hi,

    Yes, I can give you access to the dashboard, but I need to know which country you’re connecting from in order to allow access through the hosting security settings.

    Looking forward to your reply!

    Best regards.

    #666708

    Luke Nielsen
    Keymaster

    Hello,

    My IP – 176.98.90.60, ukraine.

    I await your response.

    Kind Regards

    #666719

    Hi,

    Thank you! I’ve now allowed access from your country and IP address.

    You can find the login details in the private field.

    Let me know if you need anything else.

    Best regards,

    #666781

    Luke Nielsen
    Keymaster

    Hello,

    Try to add the following PHP code snippet to the child theme functions.php file to do this.

    add_filter( 'woodmart_show_only_parent_categories_dropdown', '__return_true' );

    Kind Regards

    #666847

    Hi Luke,

    Thanks for your help! I’ve added the snippet using the Code Snippets plugin instead of editing functions.php, and it worked perfectly.

    Now the category dropdown in the search bar is showing only the parent categories, just as we needed.

    Really appreciate the support!

    Best regards.

    #666939

    Luke Nielsen
    Keymaster

    Hello,

    Thank you for confirming that the solution worked for you. We’re glad to hear that the category dropdown is now displaying only the parent categories as desired. If you have any other questions or need further assistance, feel free to reach out.

    Best regards

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

The topic ‘How to show only parent categories in Woodmart search dropdown?’ is closed to new replies.