Forums Forums Search & Filter Pro Hide results until submit bottom is clicked

Viewing 2 posts - 1 through 2 (of 2 total)
  • Anonymous
    #223268

    Hi again,

    (I bought a new license of the plugin since for the previous one you indicated that the support period had ended. The user with whom I wrote you what I ask you below was “Pedro Vega”, but I have decided to create a new user for this new license.)

    I am selecting products and variations in my configuration . My search engine is composed of a text box and taxonomies to add the variations. The result is shown in “Woocommerce shop”, therefore, I don’t use results.php at any time.

    Would it be possible that when loading the search engine, no results would appear until clicking on the submit button?

    I have verified in the forum that this is possible if we use the page “results.php” but in my case it is not so, since the results are shown on the same page on which the form is loaded.

    Thank you.

    Trevor
    #223272

    Such functionality would be within the scope of the theme and the template in use. Other than when the shortcode method is being used, our plugin has no direct control over your required behavior.

    The coding required would look something like this:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(85204)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
      // your current results template code here
    }

    Where the ID number (85204) would need to be whatever ID number your form is.

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