Forums › Forums › Search & Filter Pro › Woo Commerce Products & Posts, no products in results. Using Shortcode
- This topic has 7 replies, 2 voices, and was last updated 5 years, 6 months ago by Trevor.
-
Anonymous(Private) May 8, 2019 at 8:21 pm #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(Private) May 9, 2019 at 12:20 pm #210565As 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(Private) May 9, 2019 at 6:44 pm #210648Hi 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-testMy 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
-
AuthorPosts