Drop-down list of categories in wordpress?

Comrades, how can I make drop down menus with categories and next, to the right, the same drop-down menu with subcategories for the selected category from the first dropdown? And this should bring on the list of products on the shop page of WP.
Something like on the website redpower(dot)ru, only without the find button. The search should start automatically after you select a sub-category from the second drop-down list.
Can someone tell me in what direction to dig and where to think)
Ready to consider a solution to this problem under the key for a fee.
July 2nd 19 at 14:14
1 answer
July 2nd 19 at 14:16
There are 2 options:

1. When you load the page via the wp_localize_script to issue a json document with all the categories structure, first select build with PHP the usual way, the second is to build on the choice of the first select using javascript. Pulling values in the second select will be instantaneous.

2. When the page is loaded to build only the first select, if you select to send Ajax request to server and get child elements and display in the second select.

Well, the choice of the value of the second select using javascript to start the search.

PS: even Though the Toaster and not the exchange to search for artists, but if you do not manage contacts in profile.

Find more questions by tags WordPressWooCommerceTaxonomy