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 Overriding the 'Auto submit form' for selected pages?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Christian
    #183401

    Hello,

    I S&F configured for my WooCommerce Shop (so I can’t have more than 1 instance), however on an internal page I need the Auto submit form setting enabled, but then have it turned off for when the do_shortcode is added to the homepage. Is there a way of overriding the default section using a hook/action perhaps?

    Trevor Moderator
    #183404

    I am not aware of a way to do this. It would require Custom javascript on that one page to unbind the on change listener that is attached to the form, and I do not know how to do this. It would also require a submit button.

    I can ask Ross if he knows? I will flag this for him to look at.

    Christian
    #183429

    Hi Trevor,

    Yes I’ve added the Submit button, and was just going to hide it with CSS on the pages where Auto submit is enabled.

    Yes if you could ask Ross please that’d be great.

    Ross Moderator
    #183617

    Hi Christian

    Although untested and undocumented, I think there is a way this could work.

    There is an attribute on our <form> tag, which is passed to JavaScript to enable this functionality – data-auto-update

    You can change this using our undocumented filter (I didn’t want to make this public as I’m thinking of changing the implementation in v3) – search_filter_form_attributes

    Example usage would be:

    function filter_sf_atts( $atts, $sfid ) {
    	
    	//if search form ID = 225, the do something with the atts
    	if($sfid==225)
    	{
    		//modify $atts here before returning it
    		$atts['data-auto-update'] = '0';
    	}
    	
    	return $atts;
    }
    add_filter( 'search_filter_form_attributes', 'filter_sf_atts', 20, 2 );

    Hope that helps!

    Christian
    #183701

    That works perfectly, thanks Ross!

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

The topic ‘Overriding the 'Auto submit form' for selected pages?’ is closed to new replies.