Buttons to filter results by year

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Buttons to filter results by year

This topic contains 14 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 5 months ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #37575
    apbalice71
    apbalice71
    Participant

    Hi, we’d like to know if it’s possible to have buttons to filter the search results by year e.g. 2022, 2021, 2020, etc.

    #37600
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I’m afraid that type of layout is not possible. You can do drop-down or checkboxes or radio buttons.

    Best,
    Ernest Marcinko

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


    #37619
    apbalice71
    apbalice71
    Participant

    May we ask how do we have radio buttons to filter by year? i.e. selecting 2021 will show only posts from 2021. We only see the date filter with the date picker selection. And can we have both, radio buttons plus date picker at the same time?

    #37621
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Oh, I’m sorry, I was thinking it was a custom field type filter with only containing the year. For datetime/timestamp values, or post date filters only the date picker is available, I’m sorry.

    Best,
    Ernest Marcinko

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


    #37651
    apbalice71
    apbalice71
    Participant

    There’s another question concerning the datepicker. When it loads, the year dropdown shows 1999 to 2019. How can we make it show up to 2022?

    #37652
    apbalice71
    apbalice71
    Participant
    You cannot access this content.
    #37653
    apbalice71
    apbalice71
    Participant

    Hi, we found that it’s related to the setting “Minimal character count to trigger search”. When it’s less than the minimal character, it won’t do anything after filtering by date. We have the following code to trigger search by enter.

    	(function($){
    		$('input.orig').on('keyup', function(e){
    			if (e.which == 13) {
    				ASP.api(1, 1, 'searchFor', $(this).val());
    			}
    		});
    	}(WPD.dom));

    How do we make datepicker trigger search even when it’s less than the minimal character?

    #37655
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Well, that is intentional behaviour, you can maybe try this on the datepicker:

    	(function($){
    		$('.asp_datepicker').on('change', function(e){
    			ASP.api(1, 1, 'searchFor');
    		});
    	}(WPD.dom));
    Best,
    Ernest Marcinko

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


    #37661
    apbalice71
    apbalice71
    Participant

    May I ask if it’s possible to customize the datepicker or use something like https://www.daterangepicker.com/?

    #37662
    apbalice71
    apbalice71
    Participant

    We also have another question. Is it possible to have the Reset button in filters to only reset the filers but not search field, because it’ll show “no results” when I click reset.

    #37671
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I’m afraid that may not be possible. However you can change the Reset button settings not to trigger the search afterwards, only to reset everything.

    Best,
    Ernest Marcinko

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


    #37672
    apbalice71
    apbalice71
    Participant

    how do we make reset not to trigger search?

    #37673
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    This setting.

    Best,
    Ernest Marcinko

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


    #37681
    apbalice71
    apbalice71
    Participant

    Unfortunately, we already set to do nothing but it seems it’ll still trigger a search then shows no results on mobile.

    #37690
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Can you please make sure to clear the mobile device browser cache?

    I tired two different mobile devices just now, and they seemed to work okay. The reset did not trigger the search after pressing. Thank you!

    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.