Reset button in settings section does not reset the settings!

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Reset button in settings section does not reset the settings!

This topic contains 17 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 9 months ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #22146
    DivineSites
    DivineSites
    Participant

    We have the reset button in the settings section, but it’s not clearing the checkbox as we expect it to do..
    It only clears the text in the search box…

    Is there no button to completely reset the filters?

    Unable to display content. Adobe Flash is required.
    I expect it to remove the checkbox, but it doesn’t

    https://www.spectra.co.il/excel-pedia/

    Thanks

    #22148
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I can confirm this is a bug, I was able to replicated on our test environments. The checkboxes does not reset properly, when they are set as ‘uncheckbed’ by default.
    We are rolling out an update within 48 hours, I will include a fix for this issue, if that is okay with you.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #22150
    DivineSites
    DivineSites
    Participant

    Hey, great thanks for checking that out and letting me know,
    I’ll wait for the update.. Thanks!

    Oh, and what a great plugin!! One of the best interfaces around.

    #22207
    DivineSites
    DivineSites
    Participant

    Hey, Is this the update that was released today? Becuase I checked and it hasn’t solved our problem..

    One more part to this.. We have the results set to only display once someone chooses an option (either writing in the search or using the filter)..
    If these are reset, then we want all the results to go back to their initial settings again (i.e. all the resutls should be hidden) until the user enters a new search term, or selects something from the filter…

    Can you let me know if the updated should have worked, and what we can do about hiding the results if all the search and filters have been cleared..

    Thanks!

    #22225
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    The update should fix this issue. Make sure to fully clear the site, page, browser, cdn etc.. cache, and it should be visible.

    To hide the results after reset, make sure this option is adjusted like so: https://i.imgur.com/cX2wnXS.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #22347
    DivineSites
    DivineSites
    Participant

    Hi Ernest,
    The reset button is now mostly working..

    However, our list is set to DO NOT AUTOPOPULATE, so when pressing the reset button, this should reset it to the default, unpopulated view.
    Instead it’s showing results that we do not want..

    To take this one step further as well, if I select a checkbox, then this list populates. If I unselect the checkbox, so there are no checkboxes selected and no search text, we would also expect the list to be unpopulated.. ie it should only be populated if there is an active filter (search or checkbox)..


    Can you please let me know how to achieve this?

    Thanks

    #22356
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Make sure you then set the reset button action to do nothing here: https://i.imgur.com/Ft7aaii.png
    Unfortunately the filters action cannot be changed to not trigger the search when changed to the initial state though.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #22358
    DivineSites
    DivineSites
    Participant

    Hey Ernest,
    thanks.. the button is already set as you recommended..
    In this video you can see more closely the problem..

    If i click on the green reset button, then the results stay.. but if I click on the black X next to the search, the list becomes unpopulated..

    The reset button should behave the same as the X..

    Is there any way we can identify if there is an active filter at any given time?

    And is it possible to get rid of the X when there is no active filter?
    Like in this video:

    Thanks!!

    #22359
    DivineSites
    DivineSites
    Participant

    Actually, sorry I made a mistke.. I had tried changing the reset buttona action to “Nothing”, but it actually makes it do nothing..
    it just removed the checkboxes, but it doesn’t reset the list! It stays on the same filter..

    So in the previous video it’s set to trigger the live search, in this video it’s set to do nothing (the text that appears is the ‘no results found’ text’)

    #22366
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Okay, I think I get it now. You want it to close the results box, just like clicking on the “X” close icon. Is this correct?
    It might be possible via using a custom code to close the search results when it’s pressed.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #22417
    DivineSites
    DivineSites
    Participant

    Yes Ernest, this is exactly what I want to achieve.

    If there is a custom code to close the search results box, that would really help..

    But I don’t understand the “Do Nothing” option.. it literally does nothing without even reseting the search filters. Is the idea that someone has to click on SEARCH for the affect to happen?
    In that case I guess we want to change it to “trigger live search” and add your custom code to also close the search results.

    Basically the client wants it so that if nothing is selected in the filters (or the reset button is pressed) then no results would be show.

    Thanks

    #22434
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    The ‘do nothing’ will reset the filters to the initial values (as on page load), but then does not trigger the search bar, right now you have it that way. You should leave it as it is right now, and also add a custom code.

    Add this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_action('wp_footer', 'asp_close_on_reset');
    function asp_close_on_reset() {
      ?>
      <script>
      jQuery(function($){
        $.xhrPool = [];  
        $.xhrPool.abortAll = function() {
            $(this).each(function(i, jqXHR) {   //  cycle through list of recorded connection
                jqXHR.abort();  //  aborts connection
                $.xhrPool.splice(i, 1); //  removes from list by index
            });
        }
        $.ajaxSetup({
            beforeSend: function(jqXHR) { $.xhrPool.push(jqXHR); }, //  annd connection to list
            complete: function(jqXHR) {
                var i = $.xhrPool.indexOf(jqXHR);   //  get index for current connection completed
                if (i > -1) $.xhrPool.splice(i, 1); //  removes from list by index
            }
        });
        $('.asp_sb').on('click', '.asp_reset_btn', function(){
          $('.proclose').click();
          $('.proloading').css('display', 'none');
          $.xhrPool.abortAll();
        });
      });
      </script>
      <?php
    }

    This is not the best solution, but it should be okay.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #22438
    DivineSites
    DivineSites
    Participant

    Hey Ernest,
    Thanks for the code, I checked it out now and it’s working fine!

    Just with regards to when someone activates a checkbox filter, and then removes the checkbox, so there are no more active filters or search..
    Would it be possible in this case to use the code you sent to hide the results?

    Is there a way to identify if there are any active filters on the page?

    Thanks

    #22444
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    At the moment, I’m afraid that is not possible. I think I will add an API function to somehow check if the search is at it’s initial status, so that it can be implemented in the future.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #22794
    DivineSites
    DivineSites
    Participant

    Hey man, any idea when this API function will be ready?

    And if it would be something I could use to trigger the JS function that you sent?

    thanks!

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.