How to make filtering WordPress posts by taxonomy using checkboxes on AJAX?

Hello, I am writing here because faced with the unsolvable problem for themselves. On the website of the online store on Woocommerce, there is a page of brands, and on it the block checkbox with tags and a block with logos of the brands
5e27a339a8ca4742737308.png
The challenge from the customer
For example, using filters the user can choose to display the brands that produce only sofas and chairs. The filter works on the principle of a checkbox (you can select several options). Active points of the filter with a black background. If one filter is not selected, displays the entire list of brands.
In the header of the bold marked number is currently displayed brands on the page.
When changing filters figure should change.
Filtering and changing the numbers in the header should happen without reloading the page.

I understand that should work through AJAX + 've tried a bunch of plugins which did not help me. Rummaged a lot of information and all the past. Maybe there are good people who will help me, or at least "put on the right path"?
April 4th 20 at 13:16
3 answers
April 4th 20 at 13:18
Solution
Perhaps the easiest option would be to write to REST a special route, where to transfer the data, in response to a json response and using js to display the results on the page.
April 4th 20 at 13:20
Solution
faces a task from the customer
- delegate the task to a specialist https://freelance.habr.com/?utm_source=habr_qna&ut...
In this issue nothing else to recommend.

The right would describe - "I did this and that, here's the code"...
April 4th 20 at 13:22
Here's an example: https://rudrastyh.com/wordpress/ajax-post-filters.html
First you need to associate products with brands
In the admin panel, in the products tab there is a subsection of the attributes
Create the attributes of Brands and in brands creating the names of your brands
After that you need to bring is dynamically created on the page in the brands in the form of checkboxes, to show them the id in the slug of your brands (for future ajax'a)
Ie for example if you have 5 brands, displays only 5 checkboxes, if 3 - only three
Next, the query (where you want to display this data)
$args = array(
 'posts_per_page' => -1
 'tax_query' => array( 
 'taxonomy' => then the name of the attribute you created (you can see in the url bar, there will be something like taxonomy='brends'),
 'field' => 'slug',
 'terms' => $_POST['then what is stored in the id or the name of your checkboxes']
)
);
$brends = new WP_Query( $args );

And then the cycle

Find more questions by tags WordPressWooCommerce