Forums Forums Search & Filter Pro Checkboxen uncheck after ajax refresh

  • This topic has 10 replies, 2 voices, and was last updated 6 years ago by Anonymous.
Viewing 10 posts - 1 through 10 (of 11 total)
  • Anonymous
    #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

    Anonymous
    #192266
    This reply has been marked as private.
    Trevor
    #192268

    Hi 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
    #192297

    Thanks 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,
    Geert

    Trevor
    #192307

    You mean to have the terms set out more like a tag cloud, one a long line, wrapping down, instead of one per line?

    Anonymous
    #192364

    No 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
    #192421

    Ah. 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.

    Anonymous
    #192425

    Thanks 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");
    	
    ?>
    Trevor
    #192428

    The code provided needs the correct ID before the page loads, so you need to figure a way (not javascript) to do this in PHP, maybe using different templates?

Viewing 10 posts - 1 through 10 (of 11 total)