This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Few questions

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #32739
    nikolab86nikolab86
    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

    #32746
    Ernest MarcinkoErnest 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
    }
    #32747
    nikolab86nikolab86
    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 MarcinkoErnest 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);

    #32751
    nikolab86nikolab86
    Participant

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

    #32980
    nikolab86nikolab86
    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 MarcinkoErnest 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?

    #56808
    nikolab86nikolab86
    Participant

    Hi Ernest,

    I’m trying to create grouped search results on the Elementor Search Template.
    For now, I’ve added two Loop Grids, one is for posts, the other one is for FAQ (CPT). I’m planning to add more in the future.
    When I add a class name from the search to them to enable live search, it doesn’t work as expected.
    Is it possible to achieve to have different grouped search results on the page?

    Thanks,
    Nikola

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.