Search results not working

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search results not working

This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #45853
    smackey
    smackey
    Participant

    I have a search instance called Products set up which is configured to search Woocommerce products and skus. The search form is on the products page at the bottom of the hero area. (NOT the search in the top nav – that is a basic WordPress search)

    https://wordpress-786566-3960163.cloudwaysapps.com/products/

    Searching works mostly as expected on my localhost installation but displays no results on the dev server at all when I search for anything. The settings are the same in both environments.

    Valid searches are ‘cable’ or ‘cat6’. Clicking the search icon goes to a custom search page which does display the proper results. That is, except if I search for a product sku which does not display any results. _sku is set as a custom field to search so I’m not sure why that isn’t working.

    A second issue is the website uses the Swup JS page transition library so the website does not do full reloads when navigating between pages. This results in the search form not being initialized when coming from another page and all the settings fields are displaying.

    The strange thing is I upgraded from Ajax Search Lite which was working fine for me for everything except for the sku search which I couldn’t get to work. That’s why I purchased ajax search pro. With Ajax Search Lite I got results to show on the dev website and it seemed to initialize fine even with Swup JS page transitions.

    To debug I tried disabling plugins for caching, seo and redirection. I turned off varnish caching on the server and I see no errors in the log.

    #45864
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Thank you for the details!

    I checked the configuration, and the only issue I noticed was the search override was disabled on that form. After enabling and searching for SKUs, I am seemingly getting the correct results.

    I generally do not recommend using live page loaders, there is no guarantee that they account for proper header changes and trigger the right events, usually it’s trouble on the long term.
    However when I checked it seemed to work okay, aside from minor styling issues, but that is from the custom CSS, not the plugin itself.

    In the _search.scss, you have a group starting with:

    #ajaxsearchpro1_1 {

    .. but that is not correct, because that only targets the first instance of the first search bar, but when using the live loader, it will change, so instead of that you should use:

    .asp_m_1 {

    ..or maybe even this could work:

    #ajaxsearchpro1_1, #ajaxsearchpro1_2 {

    But the first one is much more generic. I suggest avoiding using IDs, because if there are shadow duplicates (from for example the live page loader), the plugin will fix it’s own ID to avoid duplicate node IDs.

    Please note that I can’t guarantee anything for customizations, that includes style changes as well.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


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

You must be logged in to reply to this topic.