Support » Plugin: WooCommerce » Woocommerce – option to add attributes in "Sort by"

  • Resolved karwal.bubble



    I have just started using this plugin. But I am looking for the option to add new created attributes in “sort by” or “shop by”. Like I have created new attribute “Location” and now I want to sort products by Location. Even I want to show group of products of each locations in widgets(sidebars). Like heading will be “Products in Otago” and show all products related to this attribute(otago).
    Anyone thr to help??


Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Mike Jolley


    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

    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?



    I’d be interested in finding out on how this can be done!


    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?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Woocommerce – option to add attributes in "Sort by"’ is closed to new replies.