Support » Plugin: WP Search Analytics » Ajax search with Flatsome theme

  • Resolved kevinnnnn

    (@kevinnnnn)


    Hi,

    This plugin seems to be great, but it isn’t working with the Flatsome theme (where search results are fetched in a list with Ajax).
    In the field “Add custom search parameters for recording the searches:” I have added “s”. It seems to be the get variable being used, but still the plugin isn’t storing the search terms.

    Am I missing something, or isn’t Flatsome supported yet?
    Thanks.

    Best regards,
    Kevin.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Cornel Raiu

    (@cornelraiu-1)

    Hello @kevinnnnn ,

    I had a look at the Flatsome Live Search repository and from the looks of it, it should be working with no problems. ( I am aware that this is an old version of the repo, but it looks to behave in the same way now )

    Can you please confirm that your search is not excluded by any of the following rules:

    Ignore search queries for these user roles:
    Ignore search queries for the above user roles even after the user has logged out:
    Exclude searches made from the following IP addresses:

    Otherwise, I can install a local WP instance with the Flatsome theme and try to get it working.

    Looking forward to hearing from you,
    Cornel

    • This reply was modified 2 years, 10 months ago by Cornel Raiu.
    Plugin Author Cornel Raiu

    (@cornelraiu-1)

    Also, you can try searching with incognito or just check and see if the “luxe” keyword appears in the Search Analytics screen. That is a search I did just now.

    Thread Starter kevinnnnn

    (@kevinnnnn)

    Dear Cornel,

    Thanks for your fast reply.
    I did not exclude myself as administrator, BUT I can see your search term “luxe”.

    I did test it myself, and I noticed that the search term is only saved in the database when I click the search icon or hit ENTER (after I’ve added the search term).
    But that’s not really how the searchbox works.

    When a user starts typing in the searchbox, the website will show a dropdown list with relevant items (at this point the search term isn’t added). When the user clicks on an product in the dropdown list, the search term isn’t added.
    If there are no relevant results, there appears an error saying that “there are no results found”. In this case, the search term isn’t added either.

    So to sum up: yes, it’s getting saved IF the user hit ENTER, or clicks the magnifying glass icon, BUT that’s not what most users will do (because a dropdown appears with relevant search items).

    Is there a way to get this working in this case?
    Thanks.

    Best regards,
    Kevin

    Plugin Author Cornel Raiu

    (@cornelraiu-1)

    Hi @kevinnnnn ,

    Thanks for the details.

    Unfortunately I don’t have the latest theme to be able to work with it and see if they added any kind of action that I can eventually bind to for getting this to work on AJAX as well.

    From what I can see in that old repo version did some kind of a bypass of the normal search so it is not going through the normal search process.

    We can, eventually use these 2 actions and create a custom function that would pass the search details into Search Analytics, but, in this case, it would mean we have to run the search a second time for getting the result count. So I would like to avoid this if possible.

    Do you have any kind of a dev site where I can go in via FTP and see the code?
    If you do, let me know so I send you an email address where you can send the FTP details.

    Let me know,
    Cornel

    Plugin Author Cornel Raiu

    (@cornelraiu-1)

    @kevinnnnn actually, I found a nulled version of the theme and their code did not change that much since the version in that repo.

    In the theme folder/inc/extensions/flatsome-live-search/flatsome-live-search.php
    there is a function named flatsome_ajax_search_posts that is responsible for running the query. It also has a filter flatsome_ajax_search_function that can be used to change the function used to change the method of pulling the posts from the database.

    Now, what we can do is create another function that would do the exact same thing get_posts (the default function) does and see if we can get it working that way.

    Let me know if you need help with the implementation and I will try to take care of it during this weekend.

    Cornel

    Plugin Author Cornel Raiu

    (@cornelraiu-1)

    Hello @kevinnnnn ,

    I will mask this thread as resolved since there was no activity for more than 2 months.

    Let me know if you still need help with it.

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Ajax search with Flatsome theme’ is closed to new replies.