Forums Forums Search & Filter Pro Woo Commerce Products & Posts, no products in results. Using Shortcode

Viewing 8 posts - 1 through 8 (of 8 total)
  • Anonymous
    #210545

    Hi,

    I am using a shortcode to display the filters and search results.

    I have a test page setup here https://www.debralynndadd.com/search-test

    I am spinning my wheels trying to get the products to be included in the results.

    Then I’d like to make a few changes listed below.

    #1 is t possible to set this up to not show results until I submit the form?
    #2 Is it possible to have the results show on the default search page?

    Thank you, Kim

    Trevor
    #210565

    As you are using our Shortcode Display Results method, then the results.php needs to be modified like this (where I have used the ID number of your form):

    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.php code here
    }

    Make sure any files you modify are in the child theme folder (if you copy our results.php file, it needs to be in a sub-folder of the child theme, called search-filter, not our plugin folder or a parent theme folder). Do NOT edit the copy of results.php that is in our plugin templates folder, as it will be overwritten by updates.

    I am not sure what you mean by #2? Is the page URL you have given me not the default search page, or do you mean the one your theme uses?

    Anonymous
    #210648

    Hi Trevor,

    Maybe I should start over.

    Is it possible to query both posts and woocommerce products in the same search?
    My test search is not giving me any products. https://www.debralynndadd.com/search-test

    My goal is to replace the current search. https://www.debralynndadd.com/super-search/

    Enter books and click the green search button, it will take you to the results: https://www.debralynndadd.com/?s=book

    Thank you

    Trevor
    #210710
    This reply has been marked as private.
    Anonymous
    #210778
    This reply has been marked as private.
    Trevor
    #210825
    This reply has been marked as private.
    Anonymous
    #210855

    Thank you, I see what I did wrong.

    If I wanted to put the results on a different page, how do I do that?

    Trevor
    #211000
    This reply has been marked as private.
Viewing 8 posts - 1 through 8 (of 8 total)