I can’t guide you sorting by attributes (taxonomies) as its pretty advanced (easier with custom fields), but this shows how to actually add extra options
http://wcdocs.woothemes.com/snippets/custom-sorting-options-ascdesc/
Thanks Mike, I will try that..
Sorry but the link you provided doesnt seem to work. I really need to customize sorting attrbutes and i cant find anywhere else information about it.
Nevermind now it works but still the documentation is for adding attributes only, not adding a new “Sort by” drop down box with e.g. Color.
Is it possible to give us a piece of code example on how to add a new sort drop box and where to put that code?
Thanks
Hi,
I’d be interested in finding out on how this can be done!
Lyse
I’m also curious if anyone ever figured this out.
Hey guys,
You can modify the Sort By select dropdown by modifiying the Sorting template. Drag the default template found in wp-content/plugins/woocommerce/templates/loop/sorting.php to your theme’s woocommerce folder. You should end up with wp-content/themes/theme-name/woocommerce/templates/loop/sorting.php. Feel free to modify away!
@fight It seems as though the real customization is in the orderby.php file located within the woocommerce plugin directory /templates/loop…
is that correct?
I’ve edited both, and the orderby.php changes the appearance of the dropdown, however I haven’t found the place to actually add in the functionality for different options for sorting.
Ideally I’d like to be able to sort by category (either by just showing the category chosen OR by showing the categories ordered ASC/DESC by their ID or slug). Any ideas/examples of this kind of custom option addition?