Skip Navigation

[Resolved] Hide Filter title when there are no results

This support ticket is created 7 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 7 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#402695

I have a page set up with parametric search which is working really well. hidden link

What I want to achieve though is to have the filter titles hidden when there are no results underneath e.g. on hidden link width, colour, design and price shouldn't be showing as there are not options to choose.

Thanks for the help.

Guy

#402775

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

You can always use jQuery code to hide such titles. You should add the following code to your filter's JS box.

jQuery(document).ready(function($){             
  $( "div.filtercontrol").not(':has(li)').hide();
});

I hope above solution will help you to resolve your issue.

#402776

Hi Minesh

This is working great for pages that I go to with a filter already pre-ticked - is there are way to make it work when you arrive at the page without any filters checked and then check one - e.g. if you go to hidden link and then check rug borders.

Thanks for the help.

Guy

#402780

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

When you visit view's filter JS box - you will see a button "Frontend Events". When you click it it will allow you to choose ajax callback events for parametric search.

Refer this image:
hidden link

Could you please add following code:

jQuery( document ).on( 'js_event_wpv_parametric_search_results_updated', function( event, data ) {
	/**
	* data.view_unique_id (string) The View unique ID hash
	* data.layout (object) The jQuery object for the View layout wrapper
	*/
       jQuery( "div.filtercontrol").not(':has(li)').hide();
	
});

I hope above solution will help you to resolve your issue.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.