Display the results information box problem.

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Display the results information box problem.

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

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #35462
    danilocubrovic05
    danilocubrovic05
    Participant

    Even though we enabled “Display the results information box?” option we can’t see result search info on this search. We have experimented with display options but without luck.
    Page that contains this search is:
    https://strucnaliteratura.rs/pitanja-i-odgovori/

    We have created simplified version of this page for testing:
    https://strucnaliteratura.rs/pitanja-i-odgovori-2/
    but does not work on that page too.

    Documentation does not help with troubleshooting this
    Can you check this problem?

    #35467
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    This feature is available for the live results list when using the plugins results container. Unfortunately the Elementor Results can not be altered to display that at the moment.
    We are working on possible solutions for one of the upcoming releases, it looks like it might be possible, but we may need to consult with Elementor developers for possible integration points.

    Best,
    Ernest Marcinko

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


    #35473
    danilocubrovic05
    danilocubrovic05
    Participant

    Thanks for fast response. Hope it will be possible soon.
    If possible notify when this feature find way to production version.

    Best regards,
    Danilo Cubrovic

    #35474
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Sure! You should get a notification once a new release is ready, then you can check the changelog for all the new features and fixes.

    Best,
    Ernest Marcinko

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


    #35516
    danilocubrovic05
    danilocubrovic05
    Participant

    Hello one more time.
    I’m trying to fix this for now buy using shortcode with custom function to show result number.

    $post_count = $GLOBALS[‘wp_query’]->found_posts;
    return “Ukupno rezultata: ” . $post_count;

    This shows total number of results with empty search but does not reduce that number when searching.

    (I have check this function via using time() and it executes ok everytime search executed and refresh data)
    So can we use something instead $GLOBALS[‘wp_query’]->found_posts to get valid number of posts when using asp?
    If we can get some more information there like search phrase too is even better.

    #35517
    danilocubrovic05
    danilocubrovic05
    Participant

    Well I kind of glue this thing but still want to check if I’m missing something. Maybe there is an better solution for this.
    I have use asp_results filter to set number of results in global variable so I can use this number for number of results if ajax search is executed.

    add_shortcode( ‘cekos_elementor_php_output_search_results_info’, ‘get_output_search_results_info’ );

    function get_output_search_results_info( $atts) {
    global $archive_count_results;
    $post_count = $GLOBALS[‘wp_query’]->found_posts;
    if ($archive_count_results){
    return “Found ” . $archive_count_results.” results from “.$post_count.” posts”;
    }else{
    return “Found ” . $post_count.” results from “.$post_count.” posts”;
    }
    }

    add_filter( ‘asp_results’, ‘asp_custom_link_results’, 10, 1 );
    function asp_custom_link_results( $results ) {
    global $archive_count_results;
    $count_results = count($results);
    $archive_count_results = $count_results;
    return $results;
    }

    #35522
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Okay, so this might not be as simple. The $wp_query->found_posts will have the correct number of results – but the $wp_query object may not be the global variable. When the page is rendered, there are many queries executed, and there is almost no way to tell which one is for the elementor query – and that may not even be set to the $wp_query global.

    The code you have there is a very clever solution, and if it works, I would recommend sticking to that. I don’t think there is a better way for it at the moment.

    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.