Few questions

This topic contains 6 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 2 years, 11 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #32739
    nikolab86
    nikolab86
    Participant

    Hi,

    I have a few questions regarding Ajax Search pro.

    The first one, I’ve noticed that you have Analytics of the most searched words/terms and I can add/post proposed words just below the search bar, but it has to be added manually. Is there’s a way to pull automatically those words based on the analytics, so to show the first 3 most searched terms?

    The second one is that when I type in the search bar the search results are automatically displaying, but when I click on the X button it removes the typed word but it doesn’t remove/resets the shown results. How can I set that, and if it’s a bug when you’ll fix/update it?

    Please refer to the files attached.

    Thanks,
    Nikola

    Attachments:
    You must be logged in to view attached files.
    #32746
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    1. I’m afraid there is no option to do that, however you can modify the words displayed there via the asp_suggested_phrases hook.

    2. That is an intended behavior, but there might be a way to trigger an empty search when clicking on the icon via a custom code.

    Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

    add_action('wp_footer', 'wp_footer_empty_on_close');
    function wp_footer_empty_on_close() {
    ?>
    <script>
      jQuery(function($){
        $('.asp_m .proclose svg').on('click touchend', function(e){
          $(this).closest('.asp_m').find('input.orig').trigger('input');
        });
      });
    </script>
    <?php
    }
    Best,
    Ernest Marcinko

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


    #32747
    nikolab86
    nikolab86
    Participant

    Hi Ernest,

    Thanks a lot for a quick reply.
    Reset on the X button worked : )

    I’ve checked the asp_suggested_phrases hook, where can I check the analytics to pull data from? Do you have it somewhere in the documentation where I can refer to?

    Thanks once again.

    Regards,
    Nikola

    #32750
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You are welcome. Unfortunately there is no technical documentation, but the class file can be found here: wp-content/plugins/ajax-search-pro/includes/classes/etc/statistics.class.php

    You can use the getTop method to get the top keyords:

    $keywords = asp_statistics::getTop($number, $searchid, true);

    Best,
    Ernest Marcinko

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


    #32751
    nikolab86
    nikolab86
    Participant

    Great, I’ll check it.
    Thanks a lot, Ernest.

    #32980
    nikolab86
    nikolab86
    Participant

    Hi Ernest,

    I have a few more questions:
    1. Is it possible to search for current page content that isn’t any CPT, post, or product, just regular content, for example FAQ (title and text)
    2. I’ve added a search id as a class to the section which is a Tab element, but when I’m searching, it doesn’t update, live search isn’t updating my content. I assume that this is happening because the content is in the Tab element, and by the way, I’m using Elementor.

    Thanks

    #32989
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    1. Do you mean like return parts of the page as individual results? That is not possible.

    2. I need to see in order to be able to tell what is wrong. Can you send a link where I can take a look at this?

    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.