Reputation: 2073
How can search product from a category by search string and others attribute?
Example:
In movie category, I have 20 product, I want to search for movie category by search string (?s='action' parameter), and others attribute like movie_type=thiller
Upvotes: 1
Views: 416
Reputation: 681
Parameters accepted by Wordpress search string are listed here: https://developer.wordpress.org/reference/classes/wp_query/parse_query/
For attribute / custom fields, meta_key
and meta_value
may be used. So the query in your example should be like
http://yoursite.com/?s=action&category_name=movie&meta_key=movie_type&meta_value=thriller
Upvotes: 1