I'm having the following problem. I have set up a Wordpress site with WooCommerce to serve a webshop with only books.
I have created some product attributes that are based on taxonomies like 'publisher' and 'author' (as multiple products can share an author or a publisher)
I would like to be able to sort my products not only on the Woocommerce default fields like 'title' and 'price' but also on these taxonomy fields. Say for example: order by Author ASC or order by publisher DESC
As far as I have discovered there is no way to do this with Wordpress core functions. Some say this is because it makes no sense to sort by taxonomy fields, but with the above example I can't understand why you don't want to sort by for example author.
I have played around with sortby meta_value, but this is just querying the direct postmeta, not the taxonomies.
I have knowledge of php, so any solutions involving additional code in my functions.php file will do.
I found out a way how to solve this: https://gist.github.com/jayarnielsen/12f3a586900aa6759639
I slightly modified the code so it equals the way Woocommerce uses to sort by the system fields "title" and "price" which is adding a url query-param named "sortby" a value structured like this: "field"-"direction" So to sort by a product property called "pa_tax1" ascending you'll need to add to the url: sortby=pa_tax1-asc