Forums › Forums › Search & Filter Pro › Checkboxen uncheck after ajax refresh
- This topic has 10 replies, 2 voices, and was last updated 6 years, 1 month ago by Anonymous.
-
Anonymous(Private) October 31, 2018 at 8:01 am #192265
Hi,
I installed search and filter on my WooCommerce site and want to use it in the shop and on the taxonomy pages.
When I’m on a taxonomy page and click on a checkbox in the filter, the Ajax-script reloads the results but then something strange happen: the resultpage shows all the products and the checkbox unchecks again.
Can you help me fix this?
Geert
Trevor(Private) October 31, 2018 at 8:54 am #192268Hi Geert
I temporarily made some changes to your site (and the form). Using the TwentySeventeen theme, if I look at the form in the right sidebar, it is missing the contents of each field.
It appears that there is some javascript that runs at two points. One is when the document loads, and it removes and rebuilds the fields (except it doesn’t rebuild them in a standard theme) and it also runs on any change.
However, why are you using v2.2.0 of our plugin? That is VERY old. The latest version is 2.4.5.
Can you update this first?
Please make a full site backup.
With such an old version, you should NOT delete the plugin from the plugins page in your WP Admin, as doing so will delete your forms also. This is not an issue with more recent versions (we are currently at v2.4.5).
You need to do the update manually (after downloading the latest version from your account area):
Manual installation instructions:
1) Deactivate S&F Pro in WP Admin Plugins page (do NOT delete the plugin from within WP Admin Plugins page; otherwise you will lose your search form)
2) Via FTP (or cpanel file manager if you have it), delete search-filter-pro folder from the wp-content\plugins folder on your server. If you wish to keep the folder, just in case, do NOT rename it, instead move it UP a folder into the wp-content folder.
3) Unzip the file that you have downloaded (if you are using cPanel File manager, you can upload the zip file and then extract it in the plugins folder).
4) Upload the search-filter-pro folder to the wp-content\plugins folder on your server.
5) Activate Search & Filter Pro in WP Admin Plugins page.You may need to re-build the Search & Filter cache also (edit any form and the button to rebuild the cache is in the meta panels at the side).
Anonymous(Private) October 31, 2018 at 9:56 am #192297Thanks for the feedback, after the update everything is working fine!
Is it possible to have a field with all selected filters in a row?
Otherwise people have to scroll through all the checkboxes to see what they have selected.Kind regards,
GeertAnonymous(Private) October 31, 2018 at 2:27 pm #192364No I mean the terms that a user have selected, combined together at the top of the page.
So the users sees very quickly the filters that er active.Something you see on this page: https://www.fakkel.nl/zoeken/?q=naardense&narrow=%5B%5B%22Categorieen%22%2C%22Bijbels%22%5D%2C%5B%22Serienaam%22%2C%22Serie%3A%20Dundruk%22%5D%5D&sort_by=price_min_to_max&disable_semantics=1
There is a block with ‘Filters’ and then some labels with the active filters.Trevor(Private) October 31, 2018 at 5:51 pm #192421Ah. It is not so easy with the current version, but V3 (maybe Spring 2019) may have this feature. You can do it using code, but it may end up being complex. See here:
https://searchandfilter.com/documentation/accessing-search-data/
There are also many threads looking at the coding, where users have shared their code.
Trevor(Private) October 31, 2018 at 5:53 pm #192423This thread might help you:
https://support.searchandfilter.com/forums/topic/accessing-field-slug-on-search-results/
… and this search will give similar threads I think:
https://support.searchandfilter.com/forums/search/sf_current_query+get_array+field+%5Bvalue%5D/
Anonymous(Private) October 31, 2018 at 6:14 pm #192425Thanks for the links about this subject and great to hear about this option coming to the plugin in 2019.
In this guide: https://searchandfilter.com/documentation/accessing-search-data/
I have to use a code and replace it with the form-id. But I have 9 different forms, using the same page-template, who are switched on and off by some widget logic.
Is their a possibility to use this code and let the code search for the right for id who is active on the page the user is visiting?:<?php //Get a single fields values using labels //replace <code>1526</code> with the ID of your search form global $searchandfilter; $sf_current_query = $searchandfilter->get(1526)->current_query(); echo $sf_current_query->get_field_string("_sft_category"); ?>
-
AuthorPosts