Every WooCommerce site needs WooCommerce system order to be good e-commerce site.
When customer visits e-commerce site, he or she in hurry.
So when person is in hurry and has to do his or her shopping, what he or she will need they will search for input box on that site.
In that search box, they will type their desire product name, color etc and the product will come to their screen.
There is no option currently, we will update soon..
How to add custom search field and filter products. you can add custom search field by action hook and filter products as well, Step 1.
Add search input field add action WCProductFilter field my custom input { $WCProductFilter = isset sanitize text field . check this to ensure for is submitted from WCProductFilter $ custom input = isset sanitize text field ..
Do not forget to sanitization if $ custom input = endif * * * you can check conditional here * * if ) * execute code shop page * endif * * * if ) this will display under shop page and hide others page >.. < php endif }.
Step 2 verify input variable and put on product query arguments add action WCProductFilter pre get posts query my custom input { $WCProductFilter = isset sanitize text field . $ custom input = isset sanitize text field ..
Do not forget to sanitization if { you can get ans set query arguments try var dump to see available query arguments, like tax query, meta query, order, orderby $s = $query args->get $query args->set } }.
Read more