superspeedyplugins / issue-tracker

Submit bugs and feature requests for any of our plugins
0 stars 0 forks source link

Option to show filters AFTER search results displayed for SSF #172

Closed RexHavoc69 closed 2 months ago

RexHavoc69 commented 4 months ago
  1. Our website is large and as we add more filters it impacts the search speed.
  2. I would like an option so the users can select to 'show filters' after the search results are displayed. Search results will then be fast to display and if the user wants the filters to drill down on the results then there is still the option to load them separately.
  3. This option would also be handy for category result pages if it improves the load speed.
dhilditch commented 3 months ago

image

In the image you can see our Display on Search Results option.

Add an extra option in here:

"Show but delay execution"

Make it so that this option is disabled if the widget does not have a Display Container set, otherwise it won't make sense.

Currently - if there is a display container, we still need to run the underlying code to check if we should even display the container. In this new code, if the widget says Show but delay execution, then we would always display the container on the search results with the related ajax class (you can find the ajax class inside the tax widget).

i.e. this should be quite simple - when displaying a container like this, we can avoid running the fast cats queries and the walktree function until a user clicks the container.

Summary: with this option, the container should always be displayed and the first page load the actual SQL and walktree function will not run on initial page load, instead they will run through the ajax call using the existing ajax callback code. It should be a simple matter of avoiding the fastcatsql, the walktree, but making sure the right ajax classes are on the container to enable the other code.

dhilditch commented 2 months ago

I've ended up reverted this code out of the master branch as it's quite broken and a bit of a mess.

I'll code up the solution myself so it re-uses my existing ajax code.

dhilditch commented 2 months ago

Fixed in 5.87