When search the preview is right, but when pressing enter, there are no products found.

This topic has 4 replies, 2 voices, and was last updated 3 months, 4 weeks ago ago by Jack Richardson

  • Avatar: gewoonbovenaan
    gewoonbovenaan
    Participant
    July 28, 2025 at 09:39

    Hi,

    When doing a search the preview is right and shows the stores, but when pressing enter, there are no products found. How to solve that?

    https://gyazo.com/f4cfc0213d91797e3fa65c0ac3bc2d4a
    https://gyazo.com/153fc65f23ff1eaaedcf5197d234e4cd
    https://gyazo.com/135c5196cc10eaf1d3510272f3d016ed

    Pls let me know thanks.

    Please, contact administrator
    for this information.
    3 Answers
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    July 28, 2025 at 12:06

    Hello @gewoonbovenaan,

    We hope this message finds you well.

    We would like to inform you that no products were found in your Ajax search results. However, some custom post type items – specifically from the “Stores” post type – were successfully retrieved, as shown in the following screenshot: https://prnt.sc/O9OXkcSbKLiO.

    These custom post type items appear in the Ajax search results due to customizations you have implemented, as illustrated here: https://prnt.sc/ePB6yUqbUCQy. These modifications were made using filters within your child theme, as seen in this screenshot: https://prnt.sc/1JQSmEa6ukz9.

    If you would like these custom post types to also appear in the default search results page, you will need to adjust the search query accordingly.

    To assist with this, we have added the following code to the functions.php file of your child theme. As a result, the search results now include the desired custom post types, as demonstrated here: https://prnt.sc/LQZUGwaee8r1.

    Here is the code we implemented:

    function modify_search_posts_types_in_search_results($query) {
        if ($query->is_search && !is_admin()) {
            $query->set('post_type', array('post', 'page', 'stores'));
        }
        return $query;
    }
    add_filter('pre_get_posts', 'modify_search_posts_types_in_search_results');

    Please let us know if you have any further questions or require additional assistance.

    Best regards,
    The 8Theme Team

    Avatar: gewoonbovenaan
    gewoonbovenaan
    Participant
    August 8, 2025 at 13:52

    Hi Thank you again for assisting. Everything is working right only it should also search on the categories. is that possible? https://gyazo.com/75600a2d6ebdb808bab6fc90c5ca9845

    Pls let me know.

    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    August 8, 2025 at 15:24

    Hello @gewoonbovenaan,

    Thank you for reaching out.

    At the moment, the search functionality does not support category-based searches by default. However, you may consider implementing a custom solution or requesting additional customization through your account at https://www.8theme.com/account.

    Additionally, we encourage you to submit your suggestion via our feature request page at https://www.8theme.com/roadmap/. This will allow us to evaluate the popularity of the request and consider it for future development.

    Best regards,
    The 8Theme Team

  • Viewing 4 results - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.