How to make smart search filters?

[ad_1]

I have an inventory page on website where I have some filters and showing listings.

What i want to do is let’s say I have 2 filters for now ‘make and model’ both are dropdown filters and on changing they are sending an ajax call to server which is running a wp_query to show related posts data.

Let’s say i selected ford in model dropdown then it will make an ajax call and will show me listings with model of ford.

Now what i want is when the ajax call completes it should update the sidebar filters and populate the values according to the current data which we got from ajax call.

If we got the listings with model of ‘Ford’ then the make filters dropdown values should be changed and only show values that are related to ‘Ford’ model like F-150, Mustang, etc

I have many filters not only make and model and want all of the filters to update like this.

Can you help me how i can do this?

Thanks

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer