Forums › Forums › Search & Filter Pro › JS to not show products on load
- This topic has 10 replies, 2 voices, and was last updated 5 years, 4 months ago by
Trevor.
Viewing 10 posts - 1 through 10 (of 10 total)
-
Trevor(Private) May 4, 2020 at 3:18 pm #242521
I am assuming that you are using the WooCommerce method? You could edit the PHP template being used and add some logic to test if a filter has yet been applied, like this (change the ID to match the form you are using):
global $searchandfilter; $sf_current_query = $searchandfilter->get(1234)->current_query(); if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo '<div>Nothing to see here folks!</div>'; } else { // the current products output code here }
Anonymous(Private) May 4, 2020 at 4:45 pm #242566Thanks Trevor, I understand the logic here, but it doesnt appear to be working – potentially because I am using the AJAX to return the results, rather than a page refresh.
essetnially by wrapping the default category loop code with your conditional logic, it always says “nothing to see here folks”.
any clues?
-
AuthorPosts
Viewing 10 posts - 1 through 10 (of 10 total)