Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Datepicker Conflict with Tribe Events

Viewing 10 posts - 1 through 10 (of 12 total)
  • Cory Eastman
    #261624

    The datepicker on The Events Calendar bar is not opening when I have Search and Filter Pro activated.

    As soon as I turn it off, the datepicker works again.

    Please advise on how to fix this conflict.

    Events page on my dev install is here: https://warf.greenleafmedia.com/events/

    Trevor Moderator
    #261687
    This reply has been marked as private.
    Cory Eastman
    #261735
    This reply has been marked as private.
    Trevor Moderator
    #261758
    This reply has been marked as private.
    Trevor Moderator
    #261761

    I have referred this thread to our developer, Ross, for his input.

    Cory Eastman
    #261792

    Thanks Trevor, let me know if Ross is able to come up with a fix. Much appreciated.

    Cory Eastman
    #261919

    Any update on this conflict? Thanks

    Ross Moderator
    #262130

    Hi Cory

    I’ve been a bit snowed under but prioritising this for tomorrow – hopefully there might be a solution I can find, but it’s looking like using both datepickers on the same page won’t be possible.

    Do you intend to use both on the same page?

    If they will be on different pages, then I’m sure we can unload our scripts on those specific pages or visa versa.

    Thanks

    Cory Eastman
    #262136

    Different pages. What would be the best way to conditionally unload the Search and Filter scripts on the Events pages?

    Ross Moderator
    #262211

    Hi Corey

    So I would use this info here to unload S&F scripts:
    https://searchandfilter.com/documentation/faq/#how-do-i-remove-cssjs-files-when-i-don8217t-need-them

    But, do it conditionally.

    I am guessing, perhaps, that you only use this URL for checking your events?
    https://warf.greenleafmedia.com/events/

    That is a post type archive, so we can exclude that using: https://developer.wordpress.org/reference/functions/is_post_type_archive/

    So, overall the code should look like:

    
    add_action('wp_enqueue_scripts', 'remove_sf_scripts', 100);
    function remove_sf_scripts(){
    	if ( is_post_type_archive( 'tribe_events' ) ) {
    		wp_deregister_script( 'jquery-ui-datepicker' );
    		wp_deregister_script( 'search-filter-plugin-build' );
    		wp_deregister_script( 'search-filter-chosen-script' );
    	}
    }
    

    Let me know how you get on.

    Thanks

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

The forum ‘Search & Filter Pro’ is closed to new topics and replies.